| Bash bofh |
|
|
|
| Written by Juzzy |
| Wednesday, 16 March 2011 14:15 |
|
Bash bofh - Probably the most common question I get is, why do I need this? And my response is, you don't. In a nutshell all it does is shows you when someone logs into a new shell (that calls bash) and logs their commands to syslog. If you're one of those paranoid, anti-big gov, then sorry this probably offends you. I personally love this patch, not only does it keep up with all 80+ IT users is doing our 300-450+ linux server environment in real time, but it also lets us go back and search old commands that we did a year ago but now have forgotten. I use it for just that exclusively. It's also nice way to figure out what people did to a server if it starts acting funny, or what they did last time when it acted funny. Now if you're not offended too much, let's dig into how it's done: I've written a helper script that pulls all the patches along with bash of any version: (required ncftp) Download fetchlatest.sh.
Now you should be in the actual build directory, let's apply my bash-bofh-4.2.7.patch (currently for 4.2.7) diff -U 2 -r bash-4.2/bashhist.c bash-4.2_orig/bashhist.c Download bash-bofh-4-2-7.patch. patch -p0 < bash-bofh-4.2.7.patch Done! now compile as you normally would, if you can't remember your old ./configure line... Well that will soon be a thing of the past! Here is the /etc/rsyslog.d/10-command.conf file I use: local5.* /var/log/commands/commands.log Make sure you don't let your logrotate your custom logfile!
This should work on bash 4.2, bash 4.2.1, bash 4.2.2, bash 4.2.3, bash 4.2.4, bash 4.2.5, bash 4.2.6, bash 4.2.7 |
| Last Updated on Thursday, 17 March 2011 15:19 |


