DEV Community

Keita Onabuta
Keita Onabuta

Posted on

How to create SSH Key on Mac Terminal

Just for memorandum.

ssh-keygen -t rsa
Enter fullscreen mode Exit fullscreen mode

and you get

$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/<username>/.ssh/id_rsa): 
/Users/<username>/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/<username>/.ssh/id_rsa.
Your public key has been saved in /Users/<username>/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:O9gHqGxZOua51PfVNL6GZN/FixT6nOuXptCTOzhkqd0 <hostname>
The key's randomart image is:
+---[RSA 2048]----+
|                 |
|                 |
|                 |
|       .     .   |
|      o S   o +. |
|   . * o o =+=..o|
|    X o = *+B*=.+|
|   = o . = =oE=*.|
|    +.    . o*B  |
+----[SHA256]-----+
Enter fullscreen mode Exit fullscreen mode

There are files generated under ~/.ssh folder.

 id_rsa
 id_rsa.pub
Enter fullscreen mode Exit fullscreen mode

id_rsa : private key
id_rsa.pub : public key

Top comments (0)