Launchpad sftp: hide username in public key

Asked by sachit on 2011-11-12

In an ssh public key file, the username and host of the machine from which the login is attempted is exposed.

$cat ~.ssh/id_rsa.pub
ssh-rsa blah-garbage-random <email address hidden>

Is there some way of preventing the username(of the client) from being publicly visible when giving out a public key to a server? I dont want the login name of my computer visible on the net.

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu openssh Edit question
Assignee:
No assignee Edit question
Solved by:
Alessandro Menti
Solved:
2011-11-12
Last query:
2011-11-12
Last reply:
2011-11-12
Best Alessandro Menti (elgaton) said : #1

Yes - just pass the -C option, immediately followed by the "key comment" you want to use (e.g. -C "Launchpad SSH key") to ssh-keygen when you generate a new key pair.

To change the comment in an existing key:
-if you're using an RSAv1 key (public key stored in ~/.ssh/identity.pub - it seems NOT to be your case, I'm writing it here just for completeness), use:
ssh-keygen -c -C "new comment" [-f keyfile]
-for other key types, I think changing the comment manually should be enough, but make a backup first.

If you have already uploaded public keys with the old comment to some service like Launchpad, you'll need to upload them again, just for safety.

Thanks Alessandro Menti, that solved my question.