scp with port number specified

前端 未结 12 794
有刺的猬
有刺的猬 2021-01-29 17:03

I\'m trying to scp a file from a remote server to my local machine. Only port 80 is accessible.

I tried:

scp -p 80 username@www.myserver.com:/root/file.t         


        
12条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-29 17:33

    I'm using different ports then standard and copy files between files like this:

    scp -P 1234 user@[ip address or host name]:/var/www/mywebsite/dumps/* /var/www/myNewPathOnCurrentLocalMachine
    

    This is only for occasional use, if it repeats itself based on a schedule you should use rsync and cron job to do it.

提交回复
热议问题