ssh 公钥认证报错:Permission denied (publickey,gssapi-keyex,gssapi-with-mic).解决

ssh 公钥认证报错:Permission denied (publickey,gssapi-keyex,gssapi-with-mic).解决

(1)创建用户: hadoop

(2)修改sshd_config文件

# vi /etc/ssh/sshd_config    //开启以下内容

HostKey /etc/ssh/ssh_host_rsa_key

RSAAuthentication yes

PubkeyAuthentication yes

AuthorizedKeysFile      .ssh/authorized_keys

# /etc/init.d/sshd restart

(3)权限设置

# mkdir /home/hadoop/.ssh

# chown -R hadoop:hadoop /home/hadoop

# chmod 700 /home/hadoop

# chmod 700 /home/hadoop/.ssh

# chmod 644 /home/hadoop/.ssh/authorized_keys  //公钥文件的所有权限

# chmod 600 /home/hadoop/.ssh/id_rsa        //私钥文件的所有权限

你可能感兴趣的:(ssh 公钥认证报错:Permission denied (publickey,gssapi-keyex,gssapi-with-mic).解决)