Preface scp is the abbreviation of secure copy. scp is a command for secure remote file copying based on ssh login in Linux system. The Linux scp command can copy files and directories between Linux servers. Use syntax:
The scp parameters are as follows: -1: Force the scp command to use protocol ssh1 -2: Force the scp command to use the protocol ssh2 -4: Force the scp command to use only IPv4 addressing -6: Force the scp command to use only IPv6 addressing -B: Use batch mode (do not ask for a transfer password or phrase during the transfer) -C: Enable compression. (Pass the -C flag to ssh to turn on compression) -p: retain the modification time, access time and access permissions of the original file. -q: Do not display the transfer progress bar. -r: Recursively copy the entire directory. -v: Display output in verbose mode. scp and ssh(1) will display debugging information throughout the process. This information is used to debug connection, authentication, and configuration problems. -c cipher: Encrypt data transmission with cipher. This option will be passed directly to ssh. -F ssh_config: Specifies an alternative ssh configuration file. This parameter is passed directly to ssh. -i identity_file: Read the key file used for transmission from the specified file. This parameter is passed directly to ssh. -l limit: Limit the bandwidth that the user can use, in Kbit/s. -o ssh_option: If you are used to passing parameters using ssh_config(5), -P port: Note that it is capital P, port is the port number used for data transmission -S program: Specifies the program to use for encrypted transmission. The program must understand ssh(1) options. Test: server server ip 192.168.43.117 backup server ip 192.168.43.200 ①Copy data from local to remote: Copy the server/tmp/directory to the remote backup server/text directory: scp -r /tmp/ [email protected]: /text View the copied data on the backup server: ②Copy data from remote to local: Copy the 123.log file in the backup server/text directory to the local server/tmp/directory: scp [email protected]:/text/123.log /tmp/ scp is a command for remotely copying files in Linux. A similar command is cp, but cp only copies files locally and cannot copy files across servers. In addition, scp transmission is encrypted. It may affect the speed slightly. When your server hard disk becomes a read-only system, you can use scp to help you move the files out. In addition, scp does not take up much resources and does not increase the system load much. In this regard, rsync is far inferior to it. Although rsync is faster than scp, when there are many small files, rsync will cause the hard disk I/O to be very high, while scp will basically not affect the normal use of the system. In order to improve the security of data when scp is copied across machines, ssh connection and encryption are used. If ssh password-free login is configured between machines, no password is required when using scp. Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. If you have any questions, you can leave a message to communicate. Thank you for your support for 123WORDPRESS.COM. You may also be interested in:
|
>>: Vue project code splitting solution
If the words in the sql statement conflict with t...
Table of contents Preface What is a virtual list?...
1. Run the .sh file You can run it directly using...
Several typical values of innodb_flush_method f...
for loop Basic syntax format: for(initialize vari...
When we introduced nginx, we also used nginx to s...
Let's talk about the difference first last, t...
1. Problem reproduction: Count the total number o...
This article shares the specific code of JQuery t...
Table of contents 1. HttpGET 2. HTTP POST WebSock...
CentOS6.9 installs Mysql5.7 for your reference, t...
This article example shares the specific code of ...
1. Download MySQL Community Server 5.6.35 Downloa...
For many domestic advertisers, the creation and ev...
For those who don't know how to install the s...