Unix / Linux / Mac os under each file transfer

Speaking of each file transfer, you will have to mention the command scp.

He is an acronym for Secure copy using ssh connections and encryption, if you configure ssh between two machines Log-free secret that when using scp can not enter a password. Scp and cp compare like with like, cp is the same machine , rather scp data is transmitted on a different machine.

 

 

1. scp syntax

$ scp --help

usage: scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]

           [-l limit] [-o ssh_option] [-P port] [-S program]

           [[user@]host1:]file1 ... [[user@]host2:]file2

 

2. Command parameters:

-1 scp force command protocol ssh1 

-2 scp force command protocol ssh2 

-4 forced to use only IPv4 addressing scp command 

-6 force command only IPv6 addressing scp 

-B using batch mode (without asking transmission password or phrase during transmission) 

-C allowed compression. (The -C flag to ssh, thereby opening the compression) 

-p retain the original file modification time, access time and access rights. 

-q Do not display transfer progress bar. 

-r recursively copy the entire directory. 

-v details displayed output. scp and ssh (1) will show the whole process of debugging information. This information is used for debugging connection, authentication, and configuration problems.  

-C cipher cipher to encrypt the data transmission, this option is passed directly to ssh.  

-F ssh_config ssh specify an alternate configuration file, this parameter is directly transmitted to ssh. 

When used to read from the specified file transfer -i identity_file key file, this parameter is directly transmitted to ssh.   

-l limit a defined bandwidth can be used by the user to Kbit / s units.    

If -o ssh_option accustomed ssh_config parameter passing mode (5),  

-P port note the capital P, port is the port number used to specify the data transfer  

-S program specified procedure used for encrypted transmission. This program must be able to understand ssh (1) options.

 

3. Use Case

Transmitted to the local file server

scp local_file remote_username@remote_ip:remote_folder 

Note: Requires the server has read and write permissions.

 

Download the file from the server to the local

scp remote_username@remote_ip:remote_folder local_file

 

 

Featured today recommended

JMeter test -if Interface Controller

JMeter database operations

Jmeter interface test - regular expression

JMeter Chinese garbled return

Jmeter interface testing - parametric

JMeter interface test - Basic

Test - feelings

 

 

Consultation plus micro letter

Scan QR code

 

Welcome to introduce ourselves and recommendations, micro-channel needs to push your resume!

Please Mengchuo two-dimensional code below to learn more

Guess you like

Origin www.cnblogs.com/louiezhou/p/10980476.html