scp command to transfer files

linux remote copy: scp

 1. Command introduction:

scp provides several options, just add it after scp 
 
    -p preserves the creation time of the source file when copying files. 
    -q Do not display any prompt messages when performing a file copy. 
    -r copies the entire directory www.2cto.com  

        -v When copying files, display a prompt message

2. Usage
scp filename root@remote ip:/path/ 
 For example: scp -r /home [email protected]:/home Copy the /home directory of the local machine to the /home path of the remote host

 

Copy the test.tar the /home/adm/ directory of the remote host 192.168.1.23, then the command is:
scp /home/test.tar [email protected]:/home/adm/ Enter the password after entering 

3. Problem solving: 

3.1 not a regular file

Error scp: /usr/tools: not a regular file when transferring files under linux

1: May not have permission chmod 777 2: Add -r parameter scp -r  [email protected]:/usr/tools/xxxx
when using scp

3.2 permission dneide,please try again

vi /etc/ssh/sshd_config

 PermitRootLogin yes #Modify the parameter to yes

service sshd restart #Restart the ssh service

3.3 Confirm whether the username and password you use to log in with the ssh client are root

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326170949&siteId=291194637