I have a production system where several different people are allowed to log in to a single account - the account is for the application and not for the person as we don't have personal accounts on production servers.
For auditing purposes I want to be able to tell who logged in at what time, and as we use SSH keys to log in it seems logical to track that (as there is no other identifier to track).
When SSH authenticates a user, it logs the user name to the system's security log, but it does not log which of the authorized public keys was used in the log in. Is it possible to get OpenSSH to also report which public key was used, or maybe just the comment associated with that key?
The operating system being used is CentOS 5.6, but I'd like to also hear if its possible on other operating systems.
If you raise the
LogLevel
toVERBOSE
in your configuration file (/etc/sshd/sshd_config
or similar) it will log the fingerprint of the public key used to authenticate the user.Then you get messages like this:
You can use:
to get the fingerprint of a particular public key.
If your people are using ssh-agent, you could put this in your .bashrc:
Try playing around with the
LogLevel
parameter insshd_config
. For details, refer toman sshd_config