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 > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "how to execute rsync without a password through ssh", which is easy to understand and clear. I hope it can help you solve your doubts. Let me lead you to study and learn how to execute rsync through ssh without a password.
Rsync has two commonly used authentication methods, one is rsync-daemon, the other is ssh, in some occasions, the use of rsync-daemon will be less flexible, ssh will become the first choice.
1. Test can execute rsync through ssh (password required)
Execute rsync to ensure that the password for your account is available on the remote server and that the files can be copied to the remote server.
Example: synchronize the local directory / home/linuxprobe to the remote directory / back/linuxprobe (server address: 192.168.200.10). When you do this, the server will ask you to enter your password.
Rsync-avz-e ssh / home/linuxprobe / linuxprobe@192.168.200.10:/backup/linuxprobe/
two。 Use ssh-keygen to generate keys
Now let's configure ssh so that the password is no longer required when rsync is executed through ssh. Use ssh-keygen to generate public and secret keys on the local server.
$ssh-keygenEnter passphrase (empty for no passphrase): Enter same passphrase again:
Note: when it asks you to type passphrase and press enter, you don't need to give any password.
3. Use ssh-copy-id to copy the public key to the remote host
Use the ssh-copy-id command to copy the public key to the remote host
Ssh-copy-id-I ~ / .ssh/id_rsa.pub 192.168.200.10
Note: when you do the above, you will be asked to enter a remote host account and password, and then the public key will be automatically copied to the remote directory.
4. No password required to execute rsync via ssh
Now, you can connect to the remote host through ssh without a password
Ssh 192.168.200.10
Execute rsync again, and it will no longer require you to enter your password
Rsync-avz-e ssh / home/linuxprobe/ linuxprobe@192.168.200.10:/backup/linuxprobe/
The above is all the contents of the article "how to execute rsync through ssh without a password". 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.