Last active
January 4, 2016 01:18
-
-
Save gbarboza/8547035 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SSH1 only | |
| command="log-and-run" ...key... | |
| where log-and-run is the following script. It appends a line to a log file, containing a timestamp and the command attempted: | |
| #!/bin/sh | |
| if [ -n "$SSH_ORIGINAL_COMMAND" ] | |
| then | |
| echo "`/bin/date`: $SSH_ORIGINAL_COMMAND" >> $HOME/ssh-command-log | |
| exec $SSH_ORIGINAL_COMMAND | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment