标题:[实践OK]ssh免密码登录Permission denied (publickey,gssapi-keyex,gssapi-with-mic) 的解决方案! 出处:向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除 时间:Fri, 18 Jan 2019 11:07:33 +0000 作者:jackxiang 地址:http://jackxiang.com/post/10057/ 内容: 密钥登陆能,发现SSH不行,提示: $ssh -l xiangdong 10.244.25.** Permission denied (publickey,gssapi-keyex,gssapi-with-mic). 到: $ssh -l xiangdong 10.244.25.** xiangdong@10.244.25.89's password: 实践OK办法,能密钥能密码: cat /etc/ssh/sshd_config|grep -E "PermitRootLogin|UsePAM|PasswordAuthentication" UsePAM yes #改成NO后出现需要密钥,还登陆不了。后修改为yes后重启oK service sshd restart PermitRootLogin yes PasswordAuthentication yes root依然不行,修改UsePAM no,还是不行,后来加一个irdcops帐号且能 sudo ,也就用它去SSH就行了: $ssh -l root 10.244.25.** root@10.244.25.**'s password: Permission denied, please try again. ================================== 首先:配置ssh服务器配置文件。 在root 用户下才能配置。 vi /etc/ssh/sshd_config 权限设为no: #PermitRootLogin yes #UsePAM yes #PasswordAuthentication yes 如果前面有# 号,将#号去掉,之后将yes修改为no。 修改之后为: PermitRootLogin no UsePAM no PasswordAuthentication no 权限设为yes: RSAAuthentication yes PubkeyAuthentication yes (2)重启sshd服务 systemctl restart sshd.service systemctl status sshd.service #查看ssh服务的状态 #systemctl start sshd.service #开启ssh服务 #sytemctl enable sshd.service #ssh服务随开机启动,还有个disabled #systemctl stop sshd.ervice #停止 正常情况下应该是Active:active(running) 摘自:https://www.cnblogs.com/xubing-613/p/6844564.html Generated by Jackxiang's Bo-blog 2.1.1 Release