问基友要了台服务器,密码与密钥均不能登陆.改了密码后可以登陆,但密钥依然不能登陆.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| [root@VM_19_31_centos ~] total 80 drwxrwxrwx. 3 root root 4096 Mar 30 23:50 . dr-xr-xr-x. 24 root root 4096 Mar 30 23:51 .. -rwxrwxrwx 1 root root 790 Mar 31 00:07 .bash_history -rwxrwxrwx. 1 root root 18 May 20 2009 .bash_logout -rwxrwxrwx. 1 root root 176 May 20 2009 .bash_profile -rwxrwxrwx. 1 root root 176 Sep 23 2004 .bashrc -rwxrwxrwx. 1 root root 100 Sep 23 2004 .cshrc -rwxrwxrwx. 1 root root 12754 Dec 25 2014 install.log -rwxrwxrwx. 1 root root 5520 Dec 25 2014 install.log.syslog drwxrwxrwx 2 root root 4096 Mar 30 23:50 .ssh -rwxrwxrwx. 1 root root 129 Dec 4 2004 .tcshrc -rwxrwxrwx 1 root root 1005 Mar 30 23:50 .viminfo [root@VM_19_31_centos ~] [root@VM_19_31_centos .ssh] total 12 drwxrwxrwx 2 root root 4096 Mar 30 23:50 . drwxrwxrwx. 3 root root 4096 Mar 30 23:50 .. -rwxrwxrwx 1 root root 1157 Mar 31 00:08 authorized_keys
|
明显*.ssh/与authorized_keys*权限设置错误,改之
1 2
| chmod 700 ~/.ssh chmod 600 ~/.ssh/authorized_keys
|
退出登录,然而依然不能用密钥登陆…
猜测是sshd配置问题.去sshd_config查看
取消注释,重启sshd服务,退出登录,问题依旧……
谷歌之,用ssh -vv server来查看登陆日志,发现报we did not send a packet, disable method
谷歌之,发现是*~*的权限设置问题
退出登录,问题解决😂