Tuesday, July 10, 2012

Sorry, sudo must be setuid root.


Problem:

$ sudo su –

Sorry, sudo must be setuid root.

Solution:

Login to the server as root and do the following:

# chown root:root /usr/bin/sudo

# chmod 4111 /usr/bin/sudo

# ls -ld /usr/bin/sudo

---s--x--x 2 root root 174436 Sep 15  2010 /usr/bin/sudo

Monday, May 21, 2012

To kill / delete remote login session in Linux

Solution:            
Check login user list:
# users
# last
# who
# w
Or,
First locate the process, for example, user logged in using ssh.
# ps -ef | grep ssh
Or,
Check process ID of users
              # ps -fu username
Kill the process    
# kill -HUP parent_processid
Or,
# skill -STOP -u username
# skill -CONT -u username
# skill -KILL -u username
Command to kill and logout all users as below
# skill -KILL -v /dev/pts/*
Or,
# pkill -STOP -u username
# pkill -CONT -u username
# pkill -KILL -u username