I'm hiring a system administrator to do a short job for me but in order to be safe I'd like to log every command he does, how would I do so, or is it even possible? I know there is the (history) command but I'm pretty sure that only gives me the history for my SSH commands


EDIT: Someone marked this as a duplicate of another thread involving using the history command. However, the only flaw with that is the history command only logs commands ran in your SSH session/computer, if someone else runs commands I won't be able to see their history. So any ideas?

  • You can also remove entries from history and remove all entries. Sounds like you should only give access to the commands this administrator will need to do the job. – Ramhound Dec 15 '16 at 5:38
  • 2
    Possible duplicate of SSH Advanced Logging – Ramhound Dec 15 '16 at 5:40

In order of increasing complexity, I would look at rootsh or sudo's LOG_OUTPUT configuration options, or auditd. The last option is really the most complete, especially if you want to log every command this person does, even as non-root.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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