Note: These instructions are for Linux or Mac OS users only. Those connecting from a Windows host should skip to the Instructions (Windows) section.
- Issue the following command at a shell prompt (by default, Mac OS Terminal uses a bash shell):
ssh-keygen -t rsa -b 2048
This will create a RSA public/private key pair in the .ssh directory below your account’s home directory. For example:
- Location: ~/.ssh (where ~ is the home directory)
- Private key file name: id_rsa
- Public key file name: id_rsa.pub
- cd ~/.ssh # Change directories to the keys location
- ls -l # Verify the keys are available
- chmod 400 id_rsa* # Restrict read/write privileges to both keys
Windows does not ship with software for generating SSH keys. Although many third-party software packages can be used, this Lab Step uses PuTTYgen to generate SSH keys.
- Invoke PuTTYgen on your local Windows host
- Leave the Parameters at their default values. (RSA keys, 2048 bits.)
- Click Generate. Move your mouse to the appropriate area of the window as directed
- Click Save public key. Save the public key in a safe place with a recognizable name. (PublicWin)
- Click Save private key
- Click Yes when presented with the PuTTYgen warning about a blank passphrase
A passphrase can be used for an additional level of security. Leave it blank for this lab.
- Save the private key in a safe place with a recognizable name. Note that .ppk will automatically be appended to the name you provide (PrivateWin.ppk) Reminder: It is a security risk to share your keys with others!
If you are having trouble in a specific Hands-on Lab, be sure to take a look at our Lab Guides! Our guides will take you through the most commonly reported student concerns over our most popular Hands-on Labs!