Demand:
HostA to password-free SSH login to HostB, that is, to establish an SSH trust relationship
Implement:
1,HostA: In ~/.ssh, create SSH key pair
Execute command ssh-keygen-t RSA (requires input location Direct carriage return), default generated key pair file Id_rsa and Id_rsa.pub
2,HostB: In ~/.ssh, modify the trust file Authorized_keys
append HostA's public key file id_rsa.pub to hostB 's ~/.ssh/authorized_key S file
Verify:
HostA to password-free SSH login HostB
Summary:
I'm going to give you my public key by password-free login.
Possible surprises and workarounds:
A trust relationship is established, but it is still not possible to log in through a trust relationship and check:
1, the file permissions are correct (practice proves that this is useful)
SSH doesn ' t like it if your home or ~/.SSH directories has group write permissions. Your home directory should be writable, ~/.SSH should is, and Authorized_keys should be 600
you can also get around this by adding strictmodes off to your ssh_config file, but I ' d advise against it-fixing Permissions is the "the" to Go
2. Ensure that the sshd service is turned on
3, with the SSH configuration file about /etc/ssh/sshd_config (without practice)
It is said that you can modify the SSH service authentication method, from password Authentication to public key authentication, please Baidu "/etc/ssh/sshd_config Trust relationship "
This article is from the "Harbin Degree" blog, please make sure to keep this source http://hadoooo.blog.51cto.com/12526479/1901045
Establishing an SSH trust relationship between Linux hosts