Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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 Nov 27 '15 at 11:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .