sshlog.sh logs all your SSH sessions to the specified destination directory so you can search/recall them later.
-
Copy
sshlog.sh
to somewhere on your system and make it executable. eg:cp sshlog.sh /usr/local/bin/ chmod +x /usr/local/bin/sshlog.sh
-
Edit the
SSH_LOG_DEST
variable at the top of the script to define where your SSH log files go. -
Create an alias for the
ssh
command. Add this to your~/.bash_profile
or~/.bashrc
:alias ssh='/usr/local/bin/sshlog.sh'
-
You're done.
-
sshlog.sh
works out the hostname of the destination host by reading the parameters you send the SSH command. You can SSH in a variety of ways:ssh -o ForwardAgent=yes [email protected]
or
ssh foo -lfred -v
It should be able to cope with this just fine.
-
sshlog.sh
gzips the log files when your SSH session ends, to save disk space.
Send to: [email protected]