Prerequisites for using SCP:
1, the service side started the SSHD service
2, both local and remote systems must have the SCP this command, that is, the openssh-clients Package
"Installation Method"
[Email protected]5201351yuminstall /usr/bin/SCP -y // Method One [Email protected]5201351yuminstall openssh-clients-y // Method Two
Help on the use of commands is as follows
SCP [ -1246BCPQRV] [-C Cipher] [-F Ssh_config] [-i identity_file] [-L limit] [-O ssh_option] [-P port] [-S Program] [[Email Protected]]host1:]file1 ... [[Email Protected]]host2:]file2
Now many servers for security, will change the SSH default port 22, changed to a special port. So when it comes to SCP or SFTP
It is necessary to specify which port to migrate through. Now, special note this special port to the SCP command. Now suppose this port is 22123
"Local-----> remote"
[Email protected]5201351SCP22123 /5201351. txt [email protected]192.168 . 100.2:/opt // Copy Local file to remote server [[email protected]5201351SCP 22123 /5201351 [email protected]192.168. 100.2:/opt // Copy Local directory to remote server
"Remote-----> local"
[Email protected]5201351SCP22123 [email protected]192.168. 100.2:/root/nrpe-2.15. tar. gz/opt // copy remote file to local [[email protected]5201351SCP 22123 [email protected]192.168. 100.2:/root/abc/opt // copy remote directory to local
An SCP explanation of common Linux commands