[Linux] scp command remote replication

Source: Internet
Author: User

[Linux] scp command remote replication

In the past few days, the scp command has been used to build the environment for systems that have not been used before, so we can query how to use the information.

Scp is short for secure copy. It is mainly used for remote copying of files and directories between linux systems.

You can easily copy files and directories from another server. Generally, the remote server does not enable ftp, file sharing, or web file services.

Prerequisites:

1. You must have the permission to operate the remote system.

2. The port used for the channel is not restricted by the firewall. Of course, you can select this port. The default port is 22.

Basic Format

Scp [optional parameter] file_source file_target

-P specified port: # scp-p 4588 remote@www.abc.com:/usr/local/sin. sh/home/administrator

-R recursive copy Directory: scp-r www.cumt.edu.cn:/home/root/others/home/space/music/

-V shows the execution process

Copy from local to remote:

Scp local_file remote_username @ remote_ip: remote_folder_file

Scp local_file remote_ip: remote_folder

If a user name is specified, you only need to enter the password. If no user name is written, you need to enter the user name and password.

[root@n234 ~]# scp ./install.log root@192.168.30.237:/tmp/root@192.168.30.237's password:install.log 

./Install. og local file path

Root remote system user

Ip address of the remote system 192.168.30.237

/Tmp/directory for remote file storage

Copy from remote to local:

Scp remote_username @ remote_ip: remote_file local_file

[root@n234 ~]# scp root@192.168.30.237:/tmp/install.log /tmp/root@192.168.30.237's password:install.log                                                                                         100%   35KB  35.0KB/s   00:00
Root remote system username

Ip address of the remote system 192.168.30.237

/Tmp/install. log Remote System File Path

/Tmp/folder for local file storage

This article is from the "orangleliu notebook" blog, please be sure to keep this http://blog.csdn.net/orangleliu/article/details/38399493

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.