0
1
I'm trying to find an instant way to get to connect the ServerB, which is behind the firewall, through Server A and exchange files between Server B and my laptop.
Normally, the ssh login process looks like this.
- My Laptop->MiddleMan:
mylaptop: ssh myUser@ServerA
(password auth)
- MiddleMan->Destination:
ServerA: sudo -u sharedUser ssh ServerB
(no password)
I have to login to Server A using a restricted account myUser first, switch myUser to sharedUser on Server A, since only that sharedUser have the key for Server B. I don't have the key for Server B, and I have no privilege to r/w using myUser on Server A.
I've tried the one OpenSSH/Cookbook/Proxies and Jump Hosts, but it won't work because the myUser for Server A does not have the key (sharedUser on Server A has it) for logging in Server B.
ssh sudo su ssh
Me -----------> myUser@A ---------> sharedUser@A -----------> B
^ ^ ^
password switch user using sharedUser@A's
authentication ssh key
Questions:
I would like to know if there is a way to connect to Server B "directly" through SSH Proxy, or something else?
Is there a method to remotely exchange files with Server B using SFTP/SCP.. etc thorough serveral hops and username change?
Thanks!
1Edited. Actually I am asking for a way to transmit files between server behind several hops and local machine – oscarxvita – 2019-01-23T11:59:07.870
What is your platform on the local machine? – Martin Prikryl – 2019-01-23T13:49:21.213
@MartinPrikryl linux(centos 7) – oscarxvita – 2019-01-24T13:16:24.607