2009/08/26

Logging commands executed by ssh

If you're using bash you can add these lines to your .bashrc file.
if [ -n "$SSH_CONNECTION" ]; then
LOG=$HOME/log
date >> $LOG
echo $SSH_CONNECTION >> $LOG
echo $BASH_EXECUTION_STRING >> $LOG
fi

No comments:

Post a Comment