Step 1: We set the forwarding port:
ssh -L <port>:<R address>:22 <G user>@<G address>
Step 2: Run scp against <port> pretending 127.0.0.1 (localhost) is the remote machine, and the command will be sent to R.
For copy file from local machine to remote machine:
scp -P <port>For copy file from remote machine to local machine:path-file-name-to-be-copied<R user>@127.0.0.1:/path/to/file
scp -P <port> <R user>@127.0.0.1:/path/to/file path-file-name-to-be-copied
Reference:https://www.urbaninsight.com/2012/10/03/running-scp-through-ssh-tunnel
http://whoochee.blogspot.com/2012/07/scp-via-ssh-tunnel.html
http://www.rzg.mpg.de/networkservices/ssh-tunnelling-port-forwarding
No hay comentarios:
Publicar un comentario