How to use SCP

Source: Internet
Author: User
Tags sin secure copy

The use of SCP under Linux

The SCP is secure copy, a command that is used to remotely copy files under Linux.
Sometimes we need to get a file on a remote server that does not configure an FTP server or share, and does not have access to a file in a regular way, but only through simple SCP commands.

Copy a native file to a remote server

#scp/home/administrator/news.txt Root@192.168.6.129:/etc/squid

/home/administrator/the absolute path of the local file
News.txt local files to be copied to the server
Root is logged on to the remote server through the root user (or with other users with equal privileges)
192.168.6.129 the IP address of the remote server (you can also use the domain name or machine name)
/etc/squid Copy Local files to a path located on a remote server



Copy the files on the remote server to this computer

#scp Remote@www.abc.com:/usr/local/sin.sh/home/administrator

Remote users log on to a distant server (or use other users with equal privileges)
www.abc.com the domain name of the remote server (you can use the server IP address, of course)
/usr/local/sin.sh a file on a remote server that you want to copy to this computer
/home/administrator copy remote files to the local absolute path


Note two points:
1. If the remote server firewall has special restrictions, the SCP will go to the special port, specific port depending on the situation, the command format is as follows:
#scp-P 4588 remote@www.abc.com:/usr/local/sin.sh/home/administrator
2. Use the SCP to be aware of whether the user you are using has permission to read the appropriate files for the remote server.

Such as:

# Scp/var/log/sql-slow-queries.log Root@192.168.1.50:/root

Copy the local/var/log/sql-slow-queries.log this file to 1.50 above the/root directory

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.