LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Kicking remote users (https://www.linuxquestions.org/questions/linux-software-2/kicking-remote-users-553485/)

SpecialAgentR 05-13-2007 12:18 AM

Kicking remote users
 
Code:

[root@localhost ~]# who
root    tty1        May 11 11:39
rml0520  :0          May  9 09:13
rml0520  pts/1        May 12 13:17 (:0.0)
root    pts/1        May  9 10:02 (192.168.1.4)
root    pts/2        May 10 11:27 (192.168.1.4)

What would be the easiest way to kill both of the root users pts/1 and pts/2 that are connected through the 192 ip addresses? Thanks!

jschiwal 05-13-2007 12:51 AM

You could use ps or lsof to determine their PIDs and use kill to terminate their terminals.

man kill
man ps
man lsof
kill -l

unknownmosquito 05-13-2007 02:02 AM

or you can

Code:

ps aux | grep ssh
pkill [processnumber]

where [processnumber] is the number of the ssh process that the user is using to log into your system.

And if you want to keep a specific user out, as root you can run

Code:

passwd -l [username]
And then they cannot sign back in, because their password is locked. Unlock it with

Code:

passwd -u [username]
logically.


Ian


All times are GMT -5. The time now is 12:01 AM.