Sunday, August 7, 2011

Logout Users in Linux

Yet another newbie question that suggests people love to kill and show their power to rest of the world ;)

There is a package called procps. It includes various useful (nifty) utilities. One of such utility is skill which is responsible to send a signal to users and process such as:

Halt user terminal
Kill user and logout

The procps package contains utilities to browse the /proc filesystem, which is not a real file system but a way for the kernel to provide information about the status of entries in its process table. Procps includes ps, free, skill, pkill, pgrep, snice, tload, top, uptime, vmstat, w, watch and pdwx commands.

Task: How To Halt/Stop a User Called vivek
Open a command-line terminal (select Applications > Accessories > Terminal), and then type the following commands. First, switch to the root user by typing su - and entering the root password, when prompted (you can also use sudo if configured). Type the skill command as follows:

#ps -eaf | grep username

This will help you find the PID of the username. Next

#kill -s 9 PID

This will kill the interactive session of the user.

No comments:

Post a Comment