SCP (Secure Copy) is a command used to transfer files between two servers connected to the internet. The general usage of the command is as follows:
scp SourceFilePath DestinationServerInfo
For example, suppose you want to transfer a file located at home/share/demo.tar.gz on your server to another server. The destination server IP address is 192.168.1.1 and the transfer directory is /home/linux/demo. Note that if the destination server uses a different port, you must specify it with -P after the scp command. Let’s say the destination server port is 1064. The command to use is:
scp -P1064 home/netinternet/demo.tar.gz root@192.168.1.1:/home/linux/demoAfter running this command, the server will connect to port 1064 of the destination server and display its MAC address, asking whether you want to proceed. After answering yes to the yes/no prompt, it will ask for the root password of the destination server. After entering the root password and pressing Enter, the file transfer will begin. Once the transfer is complete, you can verify the file exists in the directory specified in the command on the destination server.
Leave a Comment
* Your comment will be published after approval.
Comments
0No comments yet. Be the first to comment!