Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have a policy of logging all SSH session activity for CYA purposes with our clients. With PuTTY under windows this is trivial, as we can log each session to a file using PuTTY's built-in logging facility. But when working from Linux workstations, it's not quite as simple.

Note that server-side logging, while important for other reasons, is not part of what we're doing here. These session logs are for our own reference alone.

So far we've looked at the following options:

  • Logging of ALL terminal activity using script triggered either in .bash_profile or as wrapper to the login shell (far from ideal)
  • Replacing /usr/bin/ssh with a wrapper that starts a per-session log (better, but might have side-effects)
  • Forcing all employees to use PuTTY for Linux instead of ssh from the command line (also very much not ideal)

Logging needs to be totally automatic, and ideally we want to be able to separate out different sessions into individual files.

Related:

share|improve this question

1 Answer 1

up vote 4 down vote accepted

If you are using Linux or FreeBSD, check out sudosh2:

sudosh is an auditing shell filter and can be used as a login shell. Sudosh records all keystrokes and output and can play back the session as just like a VCR. Sudosh2 is a continuation of the development of sudosh.

This will store a log of all TTY input and output (all keystrokes, including backspaces and other control characters). The output can be stored on the local machine, or can be sent to another server using syslog.

You don't state if your engineers are SSHing from a central server, or if they are all connecting from their own workstations. sudosh2 is ideal for a central server, but might be harder to implement on dozens of workstations.

Some others have used rootsh, but I am not familiar with rootsh.

share|improve this answer
    
This is people SSHing from their own workstations into various computers owned by people all over the world. So like I said, remote logging simply isn't a possiblity; it all has to be on the workstation. –  tylerl Sep 20 '11 at 21:04

Your Answer

 
discard

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.