普通用户 hexo home 文件下的.ssh/authorized_keys 已经配置好 .ssh 文件权限以及 authorized_keys 权限如下: drwx------ 2 hexo hexo 4096 Apr 1 00:01 .ssh authorized_keys -rw------- 1 root root 401 Mar 13 17:41 authorized_keys -rw-r--r-- 1 hexo hexo 171 Apr 1 00:01 known_hosts 打印的 log 如下,哪位大神能给指点一下: λ ssh [email protected] [email protected]'s password: Last login: Sun Apr 1 00:02:00 2018 from 127.0.0.1 [hexo@VM_28_59_centos ~]$ sudo tail /var/log/secure -n 20 [sudo] password for hexo: Apr 1 00:08:49 VM_28_59_centos sshd[25151]: Disconnected from 58.218.198.167 port 11592 [preauth] Apr 1 00:08:49 VM_28_59_centos sshd[25151]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=58.218.198.167 user=root Apr 1 00:08:50 VM_28_59_centos su: pam_unix(su:session): session closed for user root Apr 1 00:08:57 VM_28_59_centos sshd[24288]: Received disconnect from 223.3.71.151 port 7153:11: disconnected by user Apr 1 00:08:57 VM_28_59_centos sshd[24288]: Disconnected from 223.3.71.151 port 7153 Apr 1 00:08:57 VM_28_59_centos sshd[24285]: pam_unix(sshd:session): session closed for user hexo Apr 1 00:09:04 VM_28_59_centos sshd[25161]: Accepted password for hexo from 223.3.71.151 port 7608 ssh2 Apr 1 00:09:04 VM_28_59_centos sshd[25161]: pam_unix(sshd:session): session opened for user hexo by (uid=0) Apr 1 00:09:05 VM_28_59_centos sshd[25161]: pam_lastlog(sshd:session): corruption detected in /var/log/btmp Apr 1 00:09:15 VM_28_59_centos sshd[25232]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=58.218.198.167 user=root Apr 1 00:09:15 VM_28_59_centos sshd[25232]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root" Apr 1 00:09:17 VM_28_59_centos sshd[25232]: Failed password for root from 58.218.198.167 port 60487 ssh2 Apr 1 00:09:17 VM_28_59_centos sshd[25232]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root" Apr 1 00:09:20 VM_28_59_centos sshd[25232]: Failed password for root from 58.218.198.167 port 60487 ssh2 Apr 1 00:09:20 VM_28_59_centos sshd[25232]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root" Apr 1 00:09:22 VM_28_59_centos sshd[25232]: Failed password for root from 58.218.198.167 port 60487 ssh2 Apr 1 00:09:22 VM_28_59_centos sshd[25232]: Received disconnect from 58.218.198.167 port 60487:11: [preauth] Apr 1 00:09:22 VM_28_59_centos sshd[25232]: Disconnected from 58.218.198.167 port 60487 [preauth] Apr 1 00:09:22 VM_28_59_centos sshd[25232]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=58.218.198.167 user=root Apr 1 00:09:23 VM_28_59_centos sudo: hexo : TTY=pts/0 ; PWD=/home/hexo ; USER=root ; COMMAND=/bin/tail /var/log/secure -n 20
1
Remember 2018-04-01 02:18:24 +08:00
排版很重要.
|
2
msg7086 2018-04-01 02:32:11 +08:00
看看 sshd_config 里是否允许了 root 登录。
|
3
nieyujiang 2018-04-01 04:29:26 +08:00
你这个排版.......
|
4
congeec 2018-04-01 07:05:15 +08:00 via iPhone
........排版就不吐槽了
我一般靠 ssh --verbose 定位问题 |
5
wqzjk393 2018-04-01 07:10:29 +08:00 via iPhone
我都是自己创建一个高权限账户,然后设置这个账户使用 sudo 时候免密码。然后平时操作实在需要 root 权限时候 sudo。没办法,vps 的 root 账户密码是很长一串随机字符串根本记不住,而且还大小写混合特别容易打错
|
7
lemual OP 问题已解决,文件权限问题。.ssh 权限设置为 700,authorized_keys 设置为 600 即可
|
8
julyclyde 2018-04-02 15:51:38 +08:00
你最开始就是 700、600 的权限啊
关键 authorized_keys 的 owner,在最开始不正确 |