Is there any way to listen in on port 22, on my server, to see if anyone submitted any commands while ssh'd into my server? Or rather, output what commands were submitted (and the ip address of who connected), almost like a 'live' log?
|
feedback
|
migrated from stackoverflow.com Apr 29 '11 at 0:00
This question came from our site for professional and enthusiast programmers.
|
The If you're running SSH on port 22 you should have extreme password requirements or use SSH Keys and disable password authentication. | |||
|
feedback
|
|
Unlikely. If you have ssh running on port 22 (as it's intended), then the communications are encrypted. w or who or last will let you see who is connected. If they're logging their commands to a history, then you could inspect their history files. Also, this should be on Super User. | |||||||||||
feedback
|
| |||
|
feedback
|
|
You can use process accounting to keep a detailed log of commands run on your server. On Debian:
Then use You can use
| |||
|
feedback
|
|
Turn up the logging on your SSH daemon.
| |||
feedback
|