gitemailsshssh-keysssh-keygen

Should I use my personal email in my ssh public keys?


Reading Github's Generating SSH keys tutorial, I saw this on the Step 2: Generate a new SSH key:

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

What bothers me is the "your_email@example.com". I know that is just a comment and it is even optional. But I was wondering, is it safe to put your email address there? Because I think it is recommended to put your machine, not your email, something like "my-machine@home".

I already used public keys following that tutorial, so my email address is in some of my public keys. Should I fix it? Or it is not a problem?


Solution

  • It's only a comment and for quick identification, really. (But one should really use fingerprints, see https://stackoverflow.com/a/32130465/800526)

    If you would like to keep your email private, you can simply change that in your public key to something else, before copying and pasting your public key.