Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use scp command to copy files remotely under Linux

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

How to use scp command to copy files remotely under Linux. To solve this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.

In Linux systems, scp is a secure remote file copy command based on ssh, which can copy files or directories between Linux servers.

Use syntax: scp [parameter] [source path] @ IP:/ destination path

The scp parameters are as follows:

-1: force the scp command to use the protocol ssh2

-2: force the scp command to use the protocol ssh3

-4: forces the scp command to use only IPv4 addressing

-6: force the scp command to use only IPv6 addressing

-B: use batch mode (transfer passwords or phrases are not asked during transfer)

-C: compression is allowed. (pass the-C flag to ssh to turn on compression)

-p: retain the modification time, access time and access rights of the original file.

-Q: the transmission progress bar is not displayed.

-r: copy the entire directory recursively.

-v: display the output in detail. Scp and ssh (1) show debugging information for the entire process. This information is used to debug connections, verify, and configure problems.

-c cipher: encrypts the data transfer in cipher, this option will be passed directly to ssh.

-F ssh_config: specify an alternate ssh configuration file, which is passed directly to ssh.

-I identity_file: reads the key file used for transfer from the specified file, and this parameter is passed directly to ssh.

-l limit: limits the bandwidth that users can use, in Kbit/s.

-o ssh_option: if you are accustomed to using the parameter passing method in ssh_config (5)

-P port: note that it is capitalized P, and port is the port number used to specify the data transfer.

-S program: specifies the program to be used for encrypted transmission. This program must be able to understand the options of ssh (1).

Test: server server ip192.168.43.117 backup server ip 192.168.43.200

① copies data from local to remote:

Copy the server server / tmp/ directory to the remote backup server / text directory:

Scp-r / tmp/ root@192.168.43.200: / text

View the copied data on the backup server:

② copies data from the remote to the local:

Copy the 123.log file from the backup server / text directory to the local server server / tmp/ directory:

Scp root@192.168.43.200:/text/123.log / tmp/

Scp is said to be an enhanced version of cp, which is not only transmitted across servers, but also encrypted.

What is Linux system Linux is a free-to-use and free-spread UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system, using Linux can run major Unix tools, applications and network protocols.

This is the answer to the question about how to use the scp command to copy files remotely under Linux. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report