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/
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.


Question information

English Edit question
Ubuntu openssh Edit question
No assignee Edit question
Solved by:
Alessandro Menti
Last query:
Last reply:
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/ - 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.