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 does Linux copy files remotely?

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

Today I will show you how Linux copies files remotely. The content of the article is good. Now I would like to share it with you. Friends who feel in need can understand it. I hope it will be helpful to you. Let's read it along with the editor's ideas.

Scp is the abbreviation of secure copy, which is a secure remote file copy command based on ssh login in Linux system. Its main function is to copy files and directories between Linux servers.

1. Copy the entire local / home/administrator/test directory to the / root directory of the remote host 192.168.1.100.

The code is as follows:

Scp-r / home/administrator/test/ root@192.168.1.100:/root/2, copy a single file to a remote host

The code is as follows:

In fact, the difference between uploading files and folders in scp / home/administrator/test/test.txt root@192.168.1.100:/root/ lies in the parameter-r, which is similar to that of cp and rm. There are more than one-r for text price increase.

3. Download remote files / folders

For example, download the / root/ folder above 192.168.0.10 to the local / home/administrator/new/ and log in using the root on the remote side

The code is as follows:

Detailed explanation of scp-r root@192.168.1.100:/root/ / home/administrator/newscp command

Syntax:

Scp [- 1246BCpqrv] [- c cipher] [- F ssh_config] [- I identity_file] [- l limit] [- o ssh_option] [- P port] [- S program] [[user@] host1:] file1 [...] [[user@] host2:] file2 is easy to write:

Scp [optional parameters] file_source file_target parameter description:

-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)

These are all the contents of how Linux copies files remotely. For more information about how Linux copies files remotely, you can search for previous articles or browse the following articles to learn! I believe the editor will add more knowledge to you. I hope you can support 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