Instructions (Linux or Mac OS)
Note: These instructions are for Linux or Mac OS users only. Those who will connect from a Windows host should skip to the Instructions (Windows) section of this Lab Step.
- 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 an 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 where the keys are
- ls -l # Make sure the keys are there
- chmod 400 id_rsa* # Restrict read/write privileges to both keys
Windows does not ship with software for generating SSH keys. Although there are many third party software packages that 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 around in 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 in this lab however.
- Save the private key in a safe place as well, 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!