Solve the Problem of entering a password for rsync synchronization Authentication

Source: Internet
Author: User
Tags rsync

There are two types of rsync operations
1. Start the rsync daemon
2. Use remote shell to process
Only the second case is recorded here, which is simpler. In fact, rsync uses SSH to authenticate users. In the absence of SSH authentication, you generally need to enter the user name and password, for example: rsync-avz -- Progress -- RSH = ssh/var/lib/MySQL root@192.168.1.2:/var/lib/MySQL, after executing this sentence, the system will prompt you to enter the user root password, in this way, the program is very uncomfortable.
Add SSH authentication:
# Ssh-keygen-T RSA
After a carriage return, two files, id_rsa id_rsa.pub, are generated. id_rsa is the private key and id_rsa.pub is the public key.
You can upload the public key to the backup server.
# SCP id_rsa.pub root@192.168.1.1: server_1
The file is stored in the user directory, and the server_1 file is copied to the. Ssh directory under the user directory.
# Mv server_1. Ssh/
Finally, import the keyAuthorized_keys File

# Cat server_1>Authorized_keys

In this way, you do not need to enter the password.


Each user has a corresponding user directory. For details, see/etc/passwd.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.