Troubleshooting: Cannot log in as root with su command

I was seeing something strange behavior on one of my server.I can log in as 'root' user using ssh but when I try to login as 'root' user using su - , it fails with " incorrect password" error.

$ su -
Password:
su: incorrect password


After some poking on the system , I was able to identify the issue . The issue was missing SUID permission for su command. 

Setting SUID command for su command resolved the issue .


# ls -l /bin/su
-rwxr-xr-x. 1 root root 34904 Oct  5  2011 /bin/su


# chmod u+s /bin/su
# ls -l /bin/su
-rwsr-xr-x. 1 root root 34904 Oct  5  2011 /bin/su

# su - user

$ su -
Password:

# id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)

Comments

Popular Posts