linux - How to transfer a file in an "indirect" ssh connection? -


i have access server in such way: localhost -> remote1 -> remote2 (my server)

[xxxx@localhost] $ ssh yyyy@remote1 [yyyy@remote1]   $ ssh zzzz@remote2 [zzzz@remote2]   $ echo "now logined server..." 

i know how transfer files scp. have no read or write permissions on remote1. how can transfer file remote2?

try this,

ssh -l localhost:8022:remote2:22 remote1 

now, can use localhost port 8022 contact 22 of remote2 via remote1. session session should active whenever need transfer. use

scp -p 8022 /path/locale/file 127.0.0.1:/path/on/remote2 

this commonly called ssh tunneling. can search , know lot it.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -