Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using sudosh to ensure, among other things, that vendors who are given ssh access to my server can be held accountable for operations they perform on the server.

sudosh is recording the logs very well, but it saves the logs with write permissions for the user who is being recorded.

How can I prevent these logs from being deleted by that user?

share|improve this question

1 Answer 1

I've implemented something better than sudosh.
Linux offers a way to do this, using the “Audit” system. With this piece of the kernel and its user space tools, you can log the system calls invoked (and other things too).
The most important one to observe is the “execve” system call. Having a record of its invocations, you’ll know what the users are doing after “sudo some_shell”.
See here for more detail.
Auditing user actions after sudo
This solution with Syslog works perfect for what you want.

share|improve this answer
diegows, added some detaail in case the link broke and to help this site. – mic84 2 days ago

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.