-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate rsa key.txt
35 lines (28 loc) · 1.46 KB
/
generate rsa key.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Generating an SSH key
An SSH key consists of a pair of files. One is the private key, which should never be shared with anyone.
The other is the public key. The other file is a public key which allows you to log into the containers and VMs you provision.
When you generate the keys, you will use ssh-keygen to store the keys in a safe location so you can bypass the login prompt when connecting to your instances.
To generate SSH keys in macOS, follow these steps:
Enter the following command in the Terminal window.
ssh-keygen -t rsa
This starts the key generation process. When you execute this command, the ssh-keygen utility prompts you to indicate where to store the key.
Press the ENTER key to accept the default location. The ssh-keygen utility prompts you for a passphrase.
Type in a passphrase. You can also hit the ENTER key to accept the default (no passphrase). However, this is not recommended.
Warning! You will need to enter the passphrase a second time to continue.
After you confirm the passphrase, the system generates the key pair.
The key's randomart image is:
+--[ RSA 2048]----+
| |
| . |
| E . |
| . . o |
| o . . S . |
| + + o . + |
|. + o = o + |
| o...o * o |
|. oo.o . |
+-----------------+
Your private key is saved to the id_rsa file in the .ssh directory
Never share your private key with anyone!
Your public key is saved to the id_rsa.pub;file
pbcopy < ~/.ssh/id_rsa.pub