We have some servers to manage. There are some user access to our server. We want to them log off or kill their processes by terminating. How can be achieve this?
We can normally logout from a linux shell with logout command like below.
Connection to cen1 closed.
Logout Other Users
We can logout other users forcibly like below. Keep in mind we need to be root to complete this command.
We get currently logged on users.
root pts/ 2016-11-07 13:45 (gateway)
test2 pts/1 2016-11-07 13:46 (gateway)
and we can logout the user test2 now
$pkill -KILL -u test2
- User -u test2 is logout
- pkill is the command which will send signals to the provided user processes
- -KILL is the kill signal to the specified user processes.