In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
What is the directory transfer command scp in Linux SSH remote files? for 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.
What is scp?
Scp is an abbreviation for secure copy, a command used to remotely copy files under Linux. Similar commands are cp, but cp is only copied locally, not across servers, and the scp transfer is encrypted. It may affect the speed slightly.
Second, what is the use of scp?
2. We need to upload the files on this machine to the remote server. The remote server does not open the ftp server or share, so it cannot be uploaded through the normal way. We only need to use the scp command to easily achieve the goal.
3. How to use scp 1. Get the files on the remote server
Scp-P 2222 root@www.vpser.net:/root/lnmp0.4.tar.gz / home/lnmp0.4.tar.gz
Upper port uppercase P is the parameter, and 2222 indicates the port after changing the SSH port. If you do not change the SSH port, you do not need to add this parameter. Root@www.vpser.net means to log in to the remote server using the root user www.vpser.net,:/root/lnmp0.4.tar.gz to indicate the file on the remote server, and the / home/lnmp0.4.tar.gz on the last side represents the path and file name saved locally.
2. Get the directory on the remote server
Scp-P 2222-r root@www.vpser.net:/root/lnmp0.4/ / home/lnmp0.4/
Upper port uppercase P is the parameter, and 2222 indicates the port after changing the SSH port. If you do not change the SSH port, you do not need to add this parameter. The-r parameter indicates recursive replication (that is, copying the files and directories under this directory); root@www.vpser.net indicates logging in to the remote server using the root user www.vpser.net,:/root/lnmp0.4/ represents the directory on the remote server, and the / home/lnmp0.4/ on the last side indicates the path saved locally.
3. Upload local files to the server
Scp-P 2222 / home/lnmp0.4.tar.gz root@www.vpser.net:/root/lnmp0.4.tar.gz
Upper port uppercase P is the parameter, and 2222 indicates the port after changing the SSH port. If you do not change the SSH port, you do not need to add this parameter. / home/lnmp0.4.tar.gz indicates the path and file name of the file to be uploaded locally. Root@www.vpser.net means logging in to the remote server using the root user www.vpser.net,:/root/lnmp0.4.tar.gz means saving the directory and file name on the remote server.
4. Upload the local directory to the server
Scp-P 2222-r / home/lnmp0.4/ root@www.vpser.net:/root/lnmp0.4/
Upper port uppercase P is the parameter, and 2222 indicates the port after changing the SSH port. If you do not change the SSH port, you do not need to add this parameter. The-r parameter indicates recursive replication (that is, copying the files and directories under this directory); / home/lnmp0.4/ indicates the directory to be uploaded, and root@www.vpser.net indicates logging in to the remote server using the root user www.vpser.net,:/root/lnmp0.4/ indicates the directory location saved on the remote server.
5. Several parameters that may be useful:
-v has the same meaning as-v in most linux commands and is used to show progress. Can be used to view connections, authentication, or configuration errors.
-C enable compression option.
-4 forcibly use IPV4 address.
-6 forcibly use IPV6 address.
The answer to the question about the directory transfer command scp in the Linux SSH remote file is shared here. I hope the above content can be of some help to everyone. 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.
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.