On a Linux server, how would I find a list of all current SSH connections, or disconnect a specific SSH connection?
feedback
|
migrated from stackoverflow.com Feb 15 '11 at 17:55
This question came from our site for professional and enthusiast programmers.
|
If you're planning to do this interactively, the simplest would be to simply invoke
This is of course not foolproof, but is extremely simple to type up on demand and easily process with the human eye. As @gravyface pointed out, if you include a | |||||
|
feedback
|
|
How about using lsof?
You should then be able to kill the offending connection (e.g., to disconnect user2):
| |||||
feedback
|
|
To view the ssh connections you can do a To drop the connection, you can try finding the PID of the sshd (SSH Daemon) with Edit: I think you can find the PID of their Another resource: this thread has some tips on the subject. | |||||||
feedback
|
|
Try this:
To disconnect them you could | |||
feedback
|