Linux remote file copy command: scp

  

scp is secure copy, is used for remote file copy. Data transfer uses ssh1, and uses the same authentication method as ssh1, providing the same security guarantee. Unlike rcp, Scp will ask you to enter a password if needed.

The simplest application is as follows:

scp local username@ipaddress:filename1 remote username@ipaddress:filename 2< Br>

[Local Username@IP Address:] You can enter the password corresponding to the remote username. You may need to enter the password corresponding to the remote username.

Several parameters may be useful:

-v and Most of the linux commands have the same meaning of -v for displaying progress. They can be used to view connections, authentication, or configuration errors.

-C Enable compression options.

-P Select port. Note that -p is already used by rcp.

-4 Force IPV4 address.

-6 Force IPV6 address.

Copy single file command:

scp file username@ip:filepath

Description:

file: The name of the file to be copied

username: username for remote login,

ip: remote server ip

filepath: remote file path

Copy folder command as follows (more plus A -r parameter can be:)

scp -r file username@ip:filepath

There are 3 ways to copy files between different Linux:

One is to install ftp server on one of the Linux, so you can copy it in another client program using ftp.

The second method is to use the samba service, similar to the way Windows file copy operation, more concise and convenient

The third is to use the scp command for file copying.

scp is a file copy with Security, based on ssh login. It is more convenient to operate. For example, to copy the current file to another remote host, you can use the following command.

scp /home/1.gif [email protected]:/home/root

Then you will be prompted to enter the login password of the root user of the other 172.19.2.75 host, and then Start cp and ungzip

If you want to reverse the operation, copy the file from the remote host to the current system, it is also very simple:

scp [email protected]:/home/abc.gif /home/root

The format of the copy folder is

scp -r [email protected]:/home//local directory

Copyright © Windows knowledge All Rights Reserved