N days to learn the SCP of a Linux command

Source: Internet
Author: User
Tags scp command

Use

Copy files between different hosts via SSH Channel


Usage

SCP [Options] [[Email protected]:]file1 [Email protected]:]file2


Common parameters

-1
Using the SSH 1 protocol

-2
Using the SSH 2 protocol

-4
Use only IPV4 addresses

-6
Use only IPV6 addresses

-B
Select batch mode, do not ask for password or other authorization information

-C
Enable compression, pass to SSH

-C cipher
Specifies the encryption algorithm that is passed to SSH

-F Ssh_config
Specifies the configuration file used by SSH, which is passed directly to SSH

-I. Identity_file
Specifies the public key file for authorization, which is passed directly to SSH

-L Limit
Speed limit, in kbit/s units

-O ssh_options
Using the form of ssh-config, pass parameters to SSH, related details query ssh-config

-P Prot
Remote host port

-P
Preserves the modification time, access time, and permissions of the source file

-Q
Silent mode, do not output any information

-R
Recursively replicate the entire directory. If it is a soft-chain file, it will copy the actual file pointing to it.

-S Program
Specifies the program used by the encrypted connection and needs to be able to identify the SSH configuration

-V
Detail mode to output detailed information as much as possible


Practice

1. Upload the directory to the remote host

[Email protected] ~]# scp-r-p-p 32800./test [email protected]:~/[email protected] ' s password:ntp.conf                                                                                                                                           100% 1830< C1/>1.8KB/S   00:00  

Remote host

[Email protected] ~]$ lltotal 8-rw-r--r--1 root   root   302 Jan 17:01 changed.logdrwxr-xr-x 2 Wadeyu nginx 4096 Feb 15:27 Test

2. Downloading files from a remote host to a local

[Email protected] ~]# scp-p-P 32800 [email protected]:~/t.log./[email protected] ' s password:t.log                                                                                                                                              100%    4     0.0kb/s   00:00    [[email protected] ~]# lltotal 37348-rw-r--r--. 1 root root 12352976 Jan  3 10:24 Node-v8.9.4-li Nux-x64.tar.xz-rw-r--r--. 1 root root  1197370 Nov  7  pip-9.0.1.tar.gz-rw-r--r--. 1 root root 22710891 Dec 13:36 python-3.6.4.tgz-rw-r--r--. 1 root root   737603 Jan  5 21:40 setuptools-38.4.0.zip-rw-r--r--. 1 root root   418354 Jul  Supervi Sor-3.3.3.tar.gz-rw-r--r--. 1 root root   802928 Jan 09:40 swoole-v2.0.10-stable.tar.gzdrwxr-xr-x. 2 root Root
   4096 Feb 15:27 test-rw-r--r--. 1 root root        4 Feb 15:55 T.log

Postscript

1. Generate the Public key certificate thumbprint
Ssh-keygen-lf./ssh_host_rsa_key.pub


Resources

"1" Man SCP
"2" a Linux command per day: SCP command
Https://www.cnblogs.com/peida/archive/2013/03/15/2960802.html
"3" How does I Find my RSA key fingerprint?
Https://stackoverflow.com/questions/9607295/how-do-i-find-my-rsa-key-fingerprint
"4" RSA and DSA
Http://www.cnblogs.com/chromebook/p/4112329.html

N days to learn the SCP of a Linux command

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.