Linux Copy command Advanced Copy SCP command detailed _linux

Source: Internet
Author: User
Tags file copy ssh scp command secure copy

Linux Command SCP

Scp-secure copy (remote file copy program): She is a secure remote file copy procedure.

Synopsis: The syntax is as follows
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

See all the above parameters, the options are covered. However, there is no relationship, we are fragmented, one to analyze.
In fact, this command is very similar to the CP we normally use.

The simplest use of SCP is the SCP [[User@]host1:]file1 ...] [User@]host2:]file2, can you read?
Do not understand it does not matter, for example: I want to copy from the 192.168.1.2 Linux host/home/oracle/*.tar files to the 192.168.1.3 Linux host/home/siebel, can be modelled on the above format:
SCP Oracle@192.168.1.2:/home/oracle/*.tar siebel@192.168.1.3:/siebel/
Enter the above command, carriage return line confirmation, may let you enter the password, according to the prompts to enter the password.
The first time it was executed, the following error occurred: Ssh:connect to host 192.168.1.99 Port 22:connection refused, the SSHD program was launched and the script was executed: #/ETC/INIT.D/SSHD star T, solve the above problem successfully.

As for the other parameters of the order, usually work in the basic use, so, not for example, simply for everyone to translate it for reference.

DESCRIPTION: Description
SCP copies files between hosts on a network.  It uses SSH (1) for data transfer, and uses the same authentication and provides as SSH (1). Unlike RCP (1), SCP would ask for passwords or passphrases if they are needed for authentication.
SCP copies data between network hosts, and she uses SSH (1) for data transmission while using the same security authentication method. Unlike RCP (1), the SCP asks for a password if necessary.

The options are as follows:
The specific options are as follows:
-1 forces SCP to use protocol 1.
Mandatory SCP Use protocol 1

-2 forces SCP to use protocol 2.
Mandatory SCP Use Protocol 2

-3 copies between two remote hosts are transferred through the local host. Without this option the data is copied
Directly between the two remote hosts. This option disables the progress meter.
Transmits data between two remote hosts through a native host. Without this option, data will be copied directly between the remote hosts. Note: This option does not support progress bar display.

-4 forces SCP to use IPV4 addresses.
Force the SCP to use only IPV4 addresses.

-6 forces SCP to use IPV6 addresses.
Force the SCP to use only IPV6 addresses.


-B Selects Batch mode (prevents asking for passwords or passphrases).
Use batch mode (avoid asking for keys or passwords)

-C Compression Enable. Passes the-c flag to SSH (1) to enable compression.
Enable compression. Pass-c parameter to SSH to enable compression

-C cipher
Selects the cipher to use for encrypting the data transfer. This option is directly passed to SSH (1).
Select Password encrypted data transfer, this option is passed directly to SSH (1).

-F Ssh_config
Specifies an alternative per-user configuration file for ssh. This option is directly passed to SSH (1).
Specify an interactive user profile for SSH and this option is passed directly to SSH (1).

-L Limit
Limits The used bandwidth, specified in kbit/s.
Limit the bandwidth used, in kilobytes.


-P Port
Specifies the port to connect to on the remote host.
To specify a link port on a remote host

-Q Quiet Mode
Silent mode:

-r recursively copy entire directories
Recursively copy Entire Directory

-S Program
The Name ' program ' to ' use ' for the encrypted connection. The program must understand SSH (1) options.
The program used to encrypt the link. This program needs the option to be able to identify SSH (1).

EXIT STATUS
Status after execution
The SCP utility exits 0 on success, and >0 if a error occurs.
SCP Tools command when successfully executed, the return code is 0, and any error returns code greater than 0

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.