Is possible to copy files over ssh during an active connection

前端 未结 1 1656
闹比i
闹比i 2021-01-27 01:36

Very often I need to copy a file from a ssh connection. Lets say a mysql dump. what I do is

local $ ssh my_server
server$ mysqldump database >> ~/export.s         


        
相关标签:
1条回答
  • 2021-01-27 02:26

    First of all, this question is off-topic here, so it will be migrated or put on hold early.

    Anyway, I described the solution for similar problem here, but it should help you: https://stackoverflow.com/a/33266538/2196426

    Summed up, yes it is possible using remote port forwarding:

    [local] $ ssh -R 2222:xyz-VirtuaBox:22 remote
    [remote]$ scp -P 2222 /home/user/test xyz@localhost:/home/user
    
    0 讨论(0)
提交回复
热议问题