Bash History
Bash History
Is it possible to send a users bash history to log server as a log file
-
- Posts: 4
- Joined: Tue Jun 20, 2023 10:09 am
- Contact:
Re: Bash History
Did some research and found some information pertaining to this subject.
It is possible to send a user's bash history to a log server as a log file in Nagios Log Server. However, this requires configuring the bash shell to log the history to a file, and then configuring the log server to collect the log file. One way to configure bash to log history to a file is to add the following lines to the .bashrc file:
Code: Select all
# Log history to file
export HISTTIMEFORMAT="%F %T "
export PROMPT_COMMAND='history -a >(tee -a ~/.bash_history | logger -t "bash[$$]")'
Once the bash history is being logged to a file, Nagios Log Server can be configured to collect the log file using the appropriate protocol (TCP, UDP, or TLS/SSL) and port. The IP address and port of the Nagios Log Server instance can be found in the Configuration Editor section of the Configure page