Here we will cover how to generate SSH keys for VPS and Dedicated plans with Root Access on a local computer for Windows, Unix, and macOS.
Generating SSH keys locally is necessary if you need to
Related Articles
Create Root SSH Keys
SSH into Shared Server
SSH into Cloud VPS
How to SSH into VPS or Dedicated Servers
Windows with PuTTy
- Open the PuTTYgen application
- 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
- Recommended: Type a secure passphrase into the Key passphrase field, and again into the Confirm passphrase field
- Click the Save public key and the Save private key buttons
- Be sure to save both keys in your user’s .ssh directory inside their home directory. For instance:
C:\Users\userna5\.ssh\id_rsa.pub
C:\Users\userna5\.ssh\id_rsa.ppk
- Be sure to save both keys in your user’s .ssh directory inside their home directory. For instance:
Windows with Powershell
- Open the Start menu and type Powershell
- Right-click on Powershell and click the Run as Administrator option
- Continue to step 2 in the macOS & Unix instructions below
macOS & Unix
- Open Terminal from your Application list
- Type the following and 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
TIP: You may not be able to see the passphrase as you type it. It is still being typed, but the characters aren't displayed. - When prompted, type the secure passphrase again to confirm, and press Enter
- You should see the following 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]-----+
TIP: If you are unable to locate this file, in a new command, type
cd ~/.ssh
to navigate to the .ssh folder, then typels -lah
to list all files in that directory.NOTE: The public key has been saved to /home/userna5/.ssh/id_rsa.pub. The text in this file is the public key that you will need to enter into the Manage SSH Keys.
Comments
0 comments
Article is closed for comments.