SCP is one of the useful tool to transfer file between one server to another.
scp file.txt root@8.8.8.8:/usr/local/src/
How to scp with port number?
scp file.txt root@8.8.8.8:/usr/local/src/
As all you know SCP command is used to copy file(s) between servers in secure way. The basic syntax of the SCP command is as follows,
scp source_file_name username@destination_host:destination_folder
For example,
scp file.txt root@8.8.8.8:/usr/local/src/
This command will copy the file named file.txt to the remote server location /usr/local/src/
You can use the scp command with providing port name with the command. For that use the syntax,
scp -P portnumber filename your_username@remotehost:destnation_folder
For example,
scp -P 2555 file.txt root@1.2.3.4:/usr/local/src/![]()
If you want to recursively copy one entire folder from one server to another please use following command.
scp -r folder username@destination_host:destination_folder
You can use below command to transfer one folder to another server Recursively with custom port.
scp -p 2555 -r folder username@destination_host:destination_folder
Thats all
Leave A Comment