Scp through ssh tunnel opened

后端 未结 1 1321
说谎
说谎 2021-01-07 13:21

I want to send files from machineA which has opened a reverse tunnel with a server. The reverse tunnel connects port 22 on machineA with port 2222 on the server:



        
1条回答
  •  再見小時候
    2021-01-07 13:59

    You can use ControlMaster option in your ssh_config (~/.ssh/config), which will create persistent connection for further ssh/scp/sftp sessions. It is easy as pie:

    Host yourhost
      Hostname fqdn.tld
      Port port_number # if required, but probably yes, if you do port-forwarding
      ControlMaster auto
      ControlPath ~/.ssh/master-%r@%h
      ControlPersist 5m
    

    0 讨论(0)
提交回复
热议问题