back to listing index

linux - How can I get the comment of the current authorized_keys ssh key? - Super User

[web search]
Original source (superuser.com)
Tags: SSH linux ssh-key authentication authorized_keys
Clipped on: 2013-10-30

Edit: What I really need to know WHICH ssh key from authorized_keys has been used to identify the currently logged on user.

According to "man sshd":

Protocol 2 public key consist of options, keytype, base64-encoded key, comment.

I see that when I use ssh-keygen, the comment is usually the local identity of the user. Is there any way to access this value when I'm on the remote computer ? (Kind of like the SSH_CLIENT shell variable)

(Assuming I enforce the comment to be a remote identity of some sort, I would like to log this from a shell-script! This is on ubuntu)

asked Aug 12 '09 at 20:30
Image (Asset 1/7) alt=