Should I use my personal email in my ssh public keys?
Asked Answered
B

2

12

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?

Bellbird answered 11/1, 2016 at 7:27 Comment(0)
S
8

It's only a comment and for quick identification, really. (But one should really use fingerprints, see https://mcmap.net/q/53075/-calculate-rsa-key-fingerprint)

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.

Sketch answered 11/1, 2016 at 7:44 Comment(0)
F
7

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.

Featherveined answered 11/1, 2016 at 8:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.