TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How To Log Bash History to Syslog

50 pointsby clyfeover 13 years ago

5 comments

atestiover 13 years ago
What does history -a do? Seems to write the history to disc and not produce something to pipe into logger. How does this work?
评论 #3225097 未加载
评论 #3225075 未加载
LXiconover 13 years ago
i would be a bit worried about accidental passwords getting into the syslog. i have typed passwords out of habit when they were not required or before a remote system responds only to have the password end up as a bash command. i then have to go into the .bash_history file and remove them.
评论 #3225608 未加载
maratdover 13 years ago
This is a very cool solution!<p>Unfortunately, it does not log the output of the command. For those that need to log absolutely everything, check out:<p><a href="https://github.com/jpschewe/rootsh" rel="nofollow">https://github.com/jpschewe/rootsh</a><p>rootsh is a wrapper shell for bash and logs everything.
giulivoover 13 years ago
there is also a library intended to do this. snoopy logger, can easily be preloaded on linux to make it work without changing the existing applications<p><a href="https://github.com/renard/snoopylogger" rel="nofollow">https://github.com/renard/snoopylogger</a>
asharpover 13 years ago
Interesting, but is there anything that can easily process syslog on the other end? ie. split data like this out into something useful?
评论 #3226469 未加载