[clug] bash history > syslog working :)

Daniel Pittman daniel at rimspace.net
Tue Aug 5 00:27:18 GMT 2008


"Ron Trujillo" <ron.trujillo at critrade.com> writes:

> Thank you all for your responses. My plan is to log every bash command
> entered to a remote syslog. Now using the function found here:
>
> http://posludio.wordpress.com/2007/11/02/bash-history-to-a-remote-syslog/
>
> I was able to get most commands to log correctly. So one issue
> down....  But, the only way it will log messages is if the user always
> uses the default shell. If they switch to use bash when their default
> is ksh then only commands run under ksh will be logged.  At this point
> I am unsure on how to resolve that.  Any Ideas???

Yes: is it your intention that this information is captured for
security, auditing or some other purpose where it actually /matters/
that the user can prevent it being logged?

If that is the case then you need to think again: this is absolutely not
suitable.  (For example, the user could remove the settings from bash,
which would have the same effect without changing shells.)

If you /really/ need to see each command run consider using some sort of
appropriate tool.  Otherwise, simply accept that many commands will
never be visible to your remote logging.

Regards,
        Daniel


More information about the linux mailing list