Last active
September 30, 2017 13:26
-
-
Save mralexjuarez/2f84fe915cf26904880bcad9a0afb79d 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
## Place the following in to ~/.bashrc | |
w4hoami="$(whoami)@$(echo $SSH_CONNECTION | awk '{print $1}')"export PROMPT_COMMAND='RETRN_VAL=$?;logger -p local6.debug "$whoami [$$]: $(history 1 | sed "s/^[ ]*[0-9]\+[ ]*//" ) [$RETRN_VAL]"' | |
## Place the following under /etc/rsyslog.d/bash.conf | |
local6.* /var/log/commands.log # Log commands to /var/log/commands |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment