How to scp with a second remote host

前端 未结 7 623
终归单人心
终归单人心 2020-12-04 05:55

I wonder if there is a way for me to SCP the file from remote2 host directly from my local machine by going through a remote1 host.

The networks only allow connectio

7条回答
  •  抹茶落季
    2020-12-04 06:22

    This configuration works nice for me:

    Host jump
       User username
       Hostname jumphost.yourorg.intranet
    Host production
       User username
       Hostname production.yourorg.intranet
       ProxyCommand ssh -q -W %h:%p jump
    

    Then the command

    scp myfile production:~
    

    Copies myfile to production machine.

提交回复
热议问题