LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Kick existing connected users (https://www.linuxquestions.org/questions/linux-security-4/kick-existing-connected-users-344648/)

loadedmind 07-19-2005 09:27 AM

Kick existing connected users
 
Through the "who" command, I can see that someone is connected to my machine (I allowed the ssh connection a week ago), but now I'm ready for him to disconnect. Is there a command that will immediately disconnect this user from my box?

Thanks,
LoadedMind

mhallbiai 07-19-2005 09:38 AM

who returns pts number
example: joeuser pts/5
ps aux | grep pts\/5 | grep -v grep
example: joeuser 4452 ... pts/5 ... /bin/bash
kill -9 4452

hope this helps

loadedmind 07-19-2005 12:38 PM

Thanks! That's exactly what I was looking for. I understood the majority of that command, with the exception of pts\/



Regards,
LoadedMind

mhallbiai 07-19-2005 03:47 PM

the \ is necessary to escape the / (tell grep that we are looking for the '/' character ;)

loadedmind 07-26-2005 07:55 AM

Ah! Thanks!


All times are GMT -5. The time now is 02:00 AM.