How to use 'scp' to directly send my file to the target location via a gateway?

In my Linux computer, usually I login into the target location by SSH:

First, SSH to gateway ,

then, SSH to the target location

However, I cannot directly transmit file /Users/david/files/A in my computer to without logining by 'scp /Users/david/files/A '

How can I do this?

1 Answer

create a tunnel first: ssh -L 2222:yy.yy.yy.yy:22 , then you can scp with scp -P 2222 A fun@localhost.

5

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like