SSH session logging

Add the following line to /etc/profile to setup full logging of all ssh sessions:

script -q /var/log/sessions/ssh-date +%d-%M-%Y-%Hh-%Mm-%Sswhoami-$$.log && exit

Of course this is a security risk and violates user privacy.

Have a project or a problem?

Talk with a senior engineer for practical recommendations—no obligation.

Leave a comment

2 Responses

  1. script command will be visible with ps. This is not the way we want, because an attacker can easily find the log and just remove it right before leaving your place.
    I’ ve found a little better solution but it still needs some work.

    sites.google.com/site/wozoopalinux/home/security/log-ssh-session

  2. I took a look at your approach .. seems valid but takes a good bit more work … guess it depends on how stealthy and long turn an implementation you’re looking for.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Categories

Get a free consultation from Reliable Penguin

Submit the form—or for immediate service call 866-649-7984.