Skip to content

Instantly share code, notes, and snippets.

@mralexjuarez
Last active September 30, 2017 13:26
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
## 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