0

Sitting on host A, connecting to jump server B with password, and then with private key (no password) to server C - from where I want to copy file to host A. Using:

scp -oProxyJump=user1@serverB jump:"/home/user2/file.txt" /home/user1/Desktop/

is not working. It asks for password to jump server B, and then I get:

..
..
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /home/user1/.ssh/id_rsa
debug1: Trying private key: /home/user1/.ssh/id_dsa
debug1: Trying private key: /home/user1/.ssh/id_ecdsa
debug1: Trying private key: /home/user1/.ssh/id_ed25519
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: No more authentication methods to try.
Permission denied (publickey,keyboard-interactive).

Obviously problem is that scp is trying to use keys from host A, instead of jump server B, where they are. Is there a way how to tell scp to use authentication keys on jump server instead of local ? Maybe something with : ?

scp -o IdentityFile

It'd be nice not to use ssh config files, just commands with options

1

I don't think there is: When using ProxyJump, the SSH/SCP client on host A will tunnel through server B, meaning no SSH/SCP client will be executed on server B, thus no easy way to use the private key on host B.

Depending on your requirements, this might be a solution:

ssh serverB ssh jump cat /home/user2/file.txt > /home/user1/Desktop/file.txt
  • that actually worked well, very nice workaround. I thought there isn't way for doing this, wanted to ask though. thanks – mauek unak Oct 18 '17 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.