SSH access allows you to have ‘command-line access’ to the server that houses your account. This gives you a secure, remote connection to your server and account. The SSH program uses a password to connect, but it is easier and more secure to use SSH ‘keys’. These keys are a type of cryptographic challenge and response that have many advantages. Shown below are a few ways to generate SSH keys of your own.
NOTE: This guide is intended for using SSH with root access with a VPS or Dedicated Server. If you are trying to use SSH and are subscribed to a Reseller or Shared Hosting plan, you can follow the directions in our guide on How to SSH into your Shared/Reseller Server (or for macOS).
Windows with Powershell
While OpenSSH is included natively on Windows 10, you will need to use the Powershell terminal to access it:
- Open the Start menu and type Powershell.
- Select Powershell and click the Run as Administrator option.
- Continue to the Unix instructions below.
Windows with PuTTY
PuTTY is a popular 3rd party software for SSH. If you prefer to utilize this tool, you can follow these steps.
- Open the PuTTYgen application. NOTE: If you don’t have PuTTYgen, you can download it from the PuTTY Download Page.
- For ‘Type of key to generate‘, select RSA.
- For ‘Number of bits in a generated key‘, select 4096.
- Click Generate.
- Move your mouse pointer around in the Key section until the progress bar is full.
- Optional: Type a comment into the Key comment section to help with identifying this SSH key pair.
- Recommended: Type a secure passphrase into the Key passphrase field, and again into the Confirm passphrase field.
- Finally, click the Save public key, and also the Save private key buttons. Be sure to save both keys in your user’s .ssh directory inside their home directory. For instance:
NOTICE: The public key can be copied from the Key field to Add an SSH Key for Cloud Server.
This applies to users with on Linux, macOS, BSD, and OpenSSH via Powershell on Windows.
- Open Terminal from your Application list.
- Type the following into the Terminal and then hit Enter: ssh-keygen -t rsa -b 4096
- Press Enter again when you see a prompt to “Enter file in which to save the key“.
- When prompted type a secure passphrase, and press Enter.
- When prompted type the secure passphrase again to confirm, and press Enter.
You should see the following successful message containing the details that pertain to your key that was generated:
userna5@localhost ~ $ ssh-keygen -t rsa -b 4096 Generating public/private rsa key pair. Enter file in which to save the key (/home/userna5/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/userna5/.ssh/id_rsa. Your public key has been saved in /home/userna5/.ssh/id_rsa.pub. The key fingerprint is: SHA256:PRxLu/LU6ZfFDve1sTIR0nK86NJVYRxRONCz0N5oy7U userna5@localhost The key's randomart image is: +---[RSA 4096]----+ | .+.+=| | . *+ | | o oo.*.| | + * ==.o| | S * =o++.| | = =+E=| | . = + .**| | = + oooo| | o ..o | +----[SHA256]-----+
NOTICE: “Your public key has been saved in /home/userna5/.ssh/id_rsa.pub“. The text in this file is the public key that you will need to Add an SSH Key for Cloud Server.
NOTE: If you are unable to locate this file simply type in cd ~/.ssh to navigate to your .ssh folder then ls -alh to list all files in that directory.