我怎么可能无法通过root su root
或身份登录su
(出现错误的密码错误),但是却可以通过ssh root@localhost
或ssh root@my_local_IP
使用相同的密码登录?
我正在使用CentOS 6.4。
更新1:
cat /etc/pam.d/su
给出:
#%PAM-1.0
auth sufficient pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth sufficient pam_wheel.so trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.
#auth required pam_wheel.so use_uid
auth include system-auth
account sufficient pam_succeed_if.so uid = 0 use_uid quiet
account include system-auth
password include system-auth
session include system-auth
session optional pam_xauth.so
Update2:
$ sudo grep su /var/log/secure | grep -v sudo
给出:
Feb 23 13:12:17 fallah su: pam_unix(su:auth): authentication failure;
logname=fallah uid=501 euid=501 tty=pts/0 ruser=fallah rhost= user=root
重复约20次。
ssh 192.168.1.218
您只是以自己的身份登录?以root身份登录ssh
通常需要ssh root@192.168.1.218
或ssh root@localhost
。
echo $$
)的PID(12345),打开(例如,通过ssh
)根外壳程序(跟踪SUID二进制文件是必需的)并启动strace
该外壳程序:strace -o su.strace -p 12345 -f
并在错误消息之前查找奇怪的错误。如果您不熟悉这种输出,或者将错误消息之前的最后30行复制到您的问题中。
Process 11736 attached - interrupt to quit
chmod 4755 /bin/su
身份输入以解决此问题。
/etc/securetty
(cp /etc/securetty{,.old}; : > /etc/securetty
)。如果仍然不起作用,请提供的内容/etc/pam.d/su
。