1, free of dense scenes
Many users and scenarios are required to implement a user-free login between machines. such as Hadoop clusters, Oracle RAC, and so on.
2, general operation-----This method is the simplest and direct, but it is between 2 points
Machine a:192.168.1.1
Machine b:192.168.1.2
Requirements: Required on machine A can use the root user-free login to machine B (Note that this is also used to log on the root user)
Steps:
(1), create your own SSH key on machine A
Ssh-keygen-t rsa-p ' All the way to the return.
(2), give your own public key to target machine B
Ssh-copy-id-i ~/.ssh//id_rsa.pub [email protected]
(3), complete the password-free login
Test:
Root login on Machine a
] #ssh [email protected]192.168.1.2.
3, multi-machine password-free login
Machine a:192.168.1.1
Machine b:192.168.1.2
Machine c:192.168.1.4
Demand:
On machine A, you can log on to machine B C via normal user test
Method One
Step: (Operation is performed using test user)
(1) Create your own SSH key on the machine a,b,c
Ssh-keygen-t rsa-p ' All the way to the return.
(2) Append all id_rsa.pub files on machine a,b,c to ~/.ssh/authorized_keys
Note The secret key and Authorized_keys permissions, the file owner is test
Transfer all ~/.ssh/authorized_keys to the machine b,c (if you want to meet 3 of each other, then all pass)
(3) complete the password-free login
Test:
Root login on Machine a
] $testssh [email protected]
] $testssh [email protected]
Can
Method Two:
Step (test user performs all of the following actions):
The most straightforward way is to generate a secret key directly on machine A.
Ssh-keygen-t rsa-p ' All the way to the return.
Then copy the test user ~/.ssh/the entire directory to the machine b,c.
Q&a
Problems:
Problem: Through the above steps, found that ordinary user login always prompt pemmission deny
Cause: 1, the normal user's home directory permissions are problematic, the normal user's home directory permissions can not be 777,
2, normal user's. ssh directory, and secret key owner permissions may be problematic.
Issue: found manually created. SSH directory (with permission of +), how can not password-free login, using ssh-keygen-t DSA automatically created. SSH directory (permissions are , you can password-free login, which can be resolved by modifying the file security context
Restorecon. ssh. Ssh/authorized_keys
This article is from the "pincer" blog, make sure to keep this source http://pincer.blog.51cto.com/5759011/1718501
Linux password-Free login FAQs