SSH: Difference between revisions
Jump to navigation
Jump to search
Anthoanthop (talk | contribs) (Created page with "=Display key fingerprints informations in /var/log/auth.log= If you have multiple users connecting to a single SSH account (ie: root) and you want to identify clearly who's co...") |
Anthoanthop (talk | contribs) No edit summary |
||
Line 4: | Line 4: | ||
Ensure this value in /etc/ssh/sshd_config: | Ensure this value in /etc/ssh/sshd_config: | ||
<syntaxhighlight lang="bash"> | |||
LogLevel VERBOSE | LogLevel VERBOSE | ||
</syntaxhighlight> | |||
<syntaxhighlight lang="bash"> | |||
/etc/init.d/ssh restart | /etc/init.d/ssh restart | ||
</syntaxhighlight> | |||
Everytime a new SSH connexion is completed you could list the fingerprint used: tail -f /var/log/auth.log | Everytime a new SSH connexion is completed you could list the fingerprint used: tail -f /var/log/auth.log | ||
Line 12: | Line 16: | ||
=To identify a fingerprint's owner by listing all entries in /root/.ssh/authorized_keys= | =To identify a fingerprint's owner by listing all entries in /root/.ssh/authorized_keys= | ||
<syntaxhighlight lang="bash"> | |||
<nowiki> | <nowiki> | ||
while read l; do | while read l; do | ||
Line 17: | Line 22: | ||
done < /root/.ssh/authorized_keys | done < /root/.ssh/authorized_keys | ||
</nowiki> | </nowiki> | ||
</syntaxhighlight> |
Revision as of 01:33, 5 December 2015
Display key fingerprints informations in /var/log/auth.log
If you have multiple users connecting to a single SSH account (ie: root) and you want to identify clearly who's connecting:
Ensure this value in /etc/ssh/sshd_config:
LogLevel VERBOSE
/etc/init.d/ssh restart
Everytime a new SSH connexion is completed you could list the fingerprint used: tail -f /var/log/auth.log
To identify a fingerprint's owner by listing all entries in /root/.ssh/authorized_keys
<nowiki>
while read l; do
[[ -n $l && ${l###} = $l ]] && ssh-keygen -l -f /dev/stdin <<<$l;
done < /root/.ssh/authorized_keys
</nowiki>