sshlog.sh logs all your SSH sessions to the specified destination directory so you can search/recall them later.
-
Copy
sshlog.shto 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_DESTvariable at the top of the script to define where your SSH log files go. -
Create an alias for the
sshcommand. Add this to your~/.bash_profileor~/.bashrc:alias ssh='/usr/local/bin/sshlog.sh' -
You're done.
-
sshlog.shworks 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 -vIt should be able to cope with this just fine.
-
sshlog.shgzips the log files when your SSH session ends, to save disk space.
Send to: [email protected]