scp with port number specified

前端 未结 12 662
有刺的猬
有刺的猬 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:43

    Hope this will help someone looking for a perfect answer

    Copying a folder or file from a server with a port defined to another server or local machine

    1. Go to a directory where you have admin rights preferably your home directory on the machine where you want to copy files to
    2. Write the command below

    scp -r -P port user@IP_address:/home/file/pathDirectory .

    **Note:** The last . on the command directs it to copy everything in that folder to your directory of preference
    

提交回复
热议问题