When the permission denied (publickey,gssapi-keyex,gssapi-with-mic) warning appears, congratulate you, you have been very close to the success.
The remote host is set to Slave2 and the user is Hadoop.
Local host set to Slave1
The following are the configurations on the remote host slave2, allowing Slave1 to connect to the Slave2 without a password. If you want to password-free interconnection, the same principle, on the slave1 is also so configured!
(1) First: Configure the SSH server configuration file.
Can be configured under the root user.
Vi/etc/ssh/sshd_config
Find the following three lines
#PermitRootLogin Yes
#UsePAM Yes
#PasswordAuthentication Yes
If there is a # number in front of it, remove the # number and then modify Yes to No.
(2) Restart sshd service
Systemctl Restart Sshd.service
Systemctl Status Sshd.service #查看ssh服务的状态
#systemctl Start Sshd.service #开启ssh服务
#sytemctl enable Sshd.service #ssh服务随开机启动, and a disabled.
#systemctl Stop Sshd.ervice #停止
(3) Modify permissions for folders and files.
#chmod 700/home/hadoop/.ssh
#chmod 644/home/hadoop/.ssh/authorized_keys
(4) test on slave1
SSH slave2
Above is the complete solution to this problem!
Summary: This warning, I think the ultimate reason is the folder and the file read and write permissions issues.
We recommend that you first modify the permissions for/home/hadoop/.ssh and/home/hadoop/.ssh/authorized_keys.
done!
SSH Password-free login permission denied (publickey,gssapi-keyex,gssapi-with-mic) solution!