2
1
I'm trying to connect to a server (with SFTP) through a gateway, but I can't find a solution with SSH tunnelling. This is how it should work :
- Connect to ssh gatewayserver using user1/password1
- sudo su - user2 (only command I can execute using sudo)
- ssh finalserver (With private key of user2)
- sudo su - finaluser
And I can't copy user2 private key anywhere since it will be considered as unsecure
Do you have any idea how can configure an SFTP/SCP client (using Mobaxterm, Putty, Winscp or another client) following these steps ?
Why do you need to do
sudo su - user2
to connect to the final server? – Martin Prikryl – 2016-12-26T10:14:15.823That is very obscure setup. – Jakuje – 2016-12-26T10:17:58.387
First sudo is needed to use the privatekey stored on user2 account to connect to final server Second sudo is because we can only connect to final server using user2 (can't do finaluser@finalserver) and then sudo to finaluser – Alkalyne – 2016-12-26T10:28:00.353
But the private key is (likely) for OpenSSH client. So that setup allows you to use the OpenSSH client on the gateway server only. You cannot wonder, that you would not be able to use any other client. – Martin Prikryl – 2016-12-26T10:31:53.123