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