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 -
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 -

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


Popular posts from this blog

PSSH : Parallel SSH to execute commands on a number of hosts

How to add check_http as a service in Nagios Monitoring using NRPE

Configuring Nagios to monitor services using NRPE