In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
How to use the scp command in linux? Many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can gain something.
In linux, the scp command is used to copy files and directories between Linux, that is, to upload local files to a remote server in a Linux server, or to download files from a remote server locally. Scp is a secure remote file copy command based on ssh login in linux system.
What is the scp command? What's the use?
Scp is the abbreviation of secure copy, and scp is a secure remote file copy command based on ssh login in linux system.
The Linux scp command is used to copy files and directories between Linux.
Note: scp is encrypted, rcp is unencrypted, and scp is an enhanced version of rcp.
Grammar
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
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).
The use of scp Command in linux
Copy local files to the remote host
User@xxx:file separates files with colons
$scp localFile user@xxx.xxx.xx:/ copy local files to remote / directory $scp localFile user@xxx.xxx.xx:~// copy local files to remote home directory
Copy the local folder to the remote host
-r indicates recursion
$scp-r abc root@xxx.xxx.xxx:~
Copy the remote file to the local
Scp root@xxx.xxx.xxx:~/awesome.txt. / scp-r root@xxx.xxx.xxx:~/awesome.txt. /
Designated port
Does the # scp command use the port number 4588scp-P 4588 remote@xxx.xxx.xxx:/usr/local/sin.sh / home/administrator to read the above content for you? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.