How do i transfer a file from my local machine to a remote host to which i need to get through a jump host? These are the steps i follow to connect to the remote host
1. ssh myname@jump-host
2. enter password
3. sudo su - another-random-name
4. ssh name@remote-host
Now i want to transfer a file from my local machine to the remote-host. How would i achieve this? I have already tried scp -oProxyCommand but i dont quite know where i should include step 3 as part of this command?
Use port forwarding to get third host ssh port on your localhost, in this way:
then (on another tab/shell on first host):
will copy directly to remote host.
On the jump host under another-random-name run
then on your local computer you can run
SCP will try to connect to
jump-host
, while in fact this connection will be forwarded to jump-host. And will usename
as it is connecting to remote-host. You are probably still facing problem with certificate for another-random-user. You can either create certificate on your machine for your-local-user and put public key on remote-host in user allowed keys.