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 the scp command of Linux

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

Share

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

This article mainly explains "how to use the scp command of Linux". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to use Linux's scp command.

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.

Command practice hostname IP address remarks web01192.168.200.28 test server (1) web02192.168.200.29 test server (2) copy local files to remote server [root@web01 ~] # scp-r / root/test root@192.168.200.29:/tmp/# command details: / root absolute path of local files test to copy to the server The local files on the root log in to the remote server through the root user (you can also use other users with the same permissions) the ip address of the 192.168.200.29 remote server (you can also use the domain name or machine name) / tmp copy the local files to the path on the remote server and copy the files on the remote server to the local [root@web01 ~] # scp-r root@192.168.200.29:/tmp/test / root/sc/# command details: root logs in to the remote server through the root user (you can also use other users with the same permissions) the ip address of the 192.168.200.29 remote server (you can also use the domain name or machine name) / tmp/test wants to copy to the remote service located on the local machine The file / root/sc/ on the device copies the remote file to the local absolute path if the remote server firewall has special restrictions Scp will have to use a special port, which port will be used according to the situation. The format of the command is as follows: [root@web01 ~] # scp-rP 1234 / root/test root@192.168.200.29:/tmp/2scp Command extension # copy folder (including folder itself) [root@web01 ~] # scp-r / root/sc root@192.168.200.29:/tmp/# copy all files under folder (excluding folder itself) [root@web01 ~] # scp-r / root/sc/ * root@192.168.200.29:/tmp/# copy files and rename [root@web01 ~] # scp-r / root/test root@192.168.200.29:/tmp/test.txt here I believe you have a better understanding of "how to use the scp command of Linux", so you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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