In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to use scp in Linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Now many people are learning Linux, in the study we often encounter a lot of problems. Today we are going to talk about Linux scp. There are three common methods for copy files between different Linux, * is ftp, that is, one of the Linux installs ftp Server, so that the other can use ftp's client program to copy the file. The second method is to use samba services, similar to the Windows file copy to operate, more simple and convenient, the third is to use the Linux scp command to copy files.
Scp is a file copy with Security, which is logged in based on ssh. It is easy to operate, for example, to copy a current file to another remote host, you can use the following command.
Scp / home/daisy/full.tar.gz root@172.19.2.75:/home/root
Then you will be prompted to enter the login password of the root user on the other 172.19.2.75 host, and then you will start cp and ungzip
It is also easy to copy files from the remote host to the current system if you want to do the reverse.
Scp root@172.19.2.75:/home/root / home/daisy/full.tar.gz
For example:
Copy local files to a remote machine
Scp / etc/lilo.conf k@net67.ee.oit.edu.tw:/home/k
The local / etc/lilo.conf file will be copy to net67.ee.oit.edu.tw, the user k's home directory.
The files on the copy remote machine come locally
Scp k@net67.ee.oit.edu.tw:/etc/lilo.conf / etc
The / etc/lilo.conf file in net67.ee.oitdu.tw will be copy to the local / etc directory.
Maintain the properties of host files from the source
Scp-p k@net67.ee.tw:/etc/lilo.conf / etc
Here, you must pay attention to whether the user has the permission to read files on the remote. If you want to know more about how to use scp, you can check the scp manual.
Ssh-keygen
Generate public key (pulib key) and private key (private key) to ensure the security of ssh online. When ssh is connected to the shd server, the public key will be exchanged, and the system will check the key stored in / etc/ssh_know_hosts. If you find the client, use this key to generate a randomly generated session key and pass it to the server. Both ends use this key to continue to complete the remaining stages of the ssh.
It generates identity.pub and identity files, the private key is stored in identity, and the public key is stored in identity.pub, and then use scp to identity.pub copy to authorized_keys under .ssh in the home directory of the remote machine. .ssh / authorized_keys (this authorized_keys file is equivalent to the agreement rhosts file), after which the user can log in without a password. RSA certification is definitely more secure and reliable than rhosts certification.
Execute:
Scp identity.pub Linux1.ee.oit.edu.tw:.ssh/authorized_keys "> k@Linux1.ee.oit.edu.tw:.ssh/authorized_keys
If you do not enter a password when using ssh-keygen to generate a key pair, you can log in to Linux1.ee.oit.edu.tw from net67.ee.oit.edu.tw without entering a password as shown above. Here, the password entered here can be different from the account password, or you can not enter the password. You can master Linux scp skillfully through the introduction of this article.
The above is all the contents of the article "how to use scp in Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.