Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 "[email protected]"

What bothers me is the "[email protected]". 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?

like image 816
Diego Mora Cespedes Avatar asked Feb 09 '23 02:02

Diego Mora Cespedes


2 Answers

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.

like image 190
Thong Kuah Avatar answered Feb 14 '23 08:02

Thong Kuah


The email is only optional field to identify the key.

When you create the ssh you type (for example):

ssh-keygen -t rsa -C "any comment can be here"

-t = The type of the key to generate 
-C = comment to identify the key

So the Comment is for you only and you can put anything inside.
Many sites and software are using this comment as the key name.

like image 44
CodeWizard Avatar answered Feb 14 '23 09:02

CodeWizard