centos7 root不能访问
root
用户无法登录了. 还好原来已经登录了root. 但是新建的连接是登录不了的.
QiuYus-Mac-mini:~ qiuyu$ ssh [email protected]
[email protected]'s password:
Permission denied, please try again.
google了一下.
[root@test ~]# systemctl status sshd -l
● sshd.service - OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
Active: active (running) since 二 2017-03-14 13:37:13 CST; 1h 56min ago
Docs: man:sshd(8)
man:sshd_config(5)
Main PID: 13731 (sshd)
CGroup: /system.slice/sshd.service
└─13731 /usr/sbin/sshd
3月 14 15:27:50 test sshd[31521]: Failed password for invalid user root from 192.168.9.61 port 56873 ssh2
3月 14 15:27:50 test sshd[31511]: Failed password for invalid user root from 192.168.10.130 port 61147 ssh2
3月 14 15:27:53 test sshd[31521]: error: Received disconnect from 192.168.9.61: 0: [preauth]
3月 14 15:31:00 test sshd[31765]: User root not allowed because shell /usr/local/bin/zsh is not executable
3月 14 15:31:00 test sshd[31765]: input_userauth_request: invalid user root [preauth]
3月 14 15:31:03 test sshd[31765]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.9.55 user=root
3月 14 15:31:03 test sshd[31765]: pam_succeed_if(sshd:auth): requirement "uid
>
= 1000" not met by user "root"
3月 14 15:31:06 test sshd[31765]: Failed password for invalid user root from 192.168.9.55 port 57343 ssh2
3月 14 15:31:08 test sshd[31765]: pam_succeed_if(sshd:auth): requirement "uid
>
= 1000" not met by user "root"
3月 14 15:31:10 test sshd[31765]: Failed password for invalid user root from 192.168.9.55 port 57343 ssh2
看到这里, 知道原因了. 是因为同事把登录的shell更改了. 改回来.
[root@test ~]# usermod -s /bin/bash root
然后重新启动sshd服务.
[root@test ~]# systemctl restart sshd.service
就可以登录了.