The following is an extract from my 'ps -ef' command:
root 1224 873 0 13:04 ? 00:00:00 /usr/sbin/sshd
root 1229 1224 0 13:05 pts/1 00:00:00 -bash
root 1615 873 0 13:28 ? 00:00:00 /usr/sbin/sshd
pje 1616 1615 0 13:28 pts/2 00:00:00 -bash
It shows that one user is logged in as root, and the other logged in as pje. However, both of the sshd processes are owned by root.
Therefore you need to find the -bash console that is associated with a specific user:
ps -ef | grep bash
will list all the people logged in using ssh. You then take the 3rd colum figure (the parent id of the process associated with the person that you want to kick - in this case pje (me!)) and kill that process.
kill -9 1615
You probable want to check that this particular process is a sshd first!
ps -ef | grep 1615
HTH:)
Main Topics
Browse All Topics





by: BlazPosted on 2006-03-02 at 02:04:42ID: 16083276
You can do that easily if you diplay the list of processes:
> ps -ef | grep sshd
...
user1 15102 15101 0 10:12 ? 00:00:00 sshd: user1@pts/1
user2 15106 15105 0 10:30 ? 00:00:00 sshd: user2@pts/2
...
if you want to disconnect user2 just kill his process:
kill -9 15106