User Tools

Site Tools


linux:linux_audit_user_commands

This is an old revision of the document!


Log user commands

Set PROMPT_COMMAND to log every command to syslog

PROMPT_COMMAND='history -a >(logger -t "[$USER] $SSH_CONNECTION")'

/etc/rsyslog.conf

# Log every command executed by a user to a separate file
local6.* /var/log/commands.log
linux/linux_audit_user_commands.1757876117.txt.gz · Last modified: 2025/09/14 20:55 by manu