How to Access your Account Using SSH Keys

Connecting to an account using SSH keys offers a more streamlined, secure, and efficient approach compared to traditional password-based authentication. Once the initial setup is completed for SSH Key, subsequent logins become hassle-free and provide a seamless experience.

If you want to run an automated process like automatically downloading a database backup at certain times to your local computer. In this scenario, you don't want to have to manually type your SSH password every time the backup process runs.

To generate Key pairs follow this process:

Step 1: Generate SSH Key Pair: If you don't have an SSH key pair, generate one on your local machine using a tool like SSH-keygen. This will create a private key and a corresponding public key.

To generate the Key pairs follow the process:

  • Start PuTTYgen.
  • Click on the Key and the SSH-2 RSA.

  • Confirm that the Number of bits in a generated key value is set to 2048.
  • Click Generate.
  • Move the mouse around to generate random data. After a few seconds, PuTTYgen creates the key.
  • Click Save public key, choose the folder, type id_rsa.pub in the File name text box, and then click Save.

  •  Click Save private key, choose the folder, type id_rsa.ppk in the File name text box, and then click Save.

  • Select all of the text in the public key for pasting into OpenSSH authorized_keys file text box, right-click on the text, and then click Copy.

 

Step 2: Add the Public Key to your Server: with N6 Cloud VPS and Cloud Server Services you can add your public to the Client panel, but for Dedicate services you need to do it manually.  

 

Log into the N6 Cloud Client area.

locate Services tab>>choose your service>>Locate SSH Keys>>Add a New SSH Key

Hit Submit button. Once it's been submitted you can see your SSH Keys under SSH Keys.

To do it manually for Dedicated services copy the content of your public key file (usually named id_rsa.pub) and log in to your server via SSH. Create an authorized_keys file if it doesn't exist:

 

Log into the N6 Cloud Client area and open your service SSH account using PuTTY.

Add the following code: 

mkdir -p ~/.ssh

nano ~/.ssh/authorized_keys

Now paste the Key that you copied in number 7. Press CTRL+X, type Y to save the file, and press ENTER to exit.

After this step add the following commands:

chmod 600 ~/.ssh/authorized_keys      

chmod 700 ~/.ssh      

Type in exit to close the connection.

 

Step 3: Configure SSH Key Authentication: 

  • Start PuTTY.
  • In the Category pane, expand SSH, and then click Auth.
  • Under Authentication Parameters, click Browse.
  • Locate the id_rsa.ppk file that you created in the previous procedure.

  • In the Category pane, click Session.
  • In the Host Name (or IP address) text box, type username@example.com. Replace username with your root username, and replace example.com with your site's domain name.
  • Confirm that the Connection type radio button is set to SSH.
  • In the Saved Sessions text box, type a name for the connection.
  • Click Save.

To connect to your SSH account, double-click the connection name in the list. PuTTY should connect without asking you to type in your account password. 

 

If you have any questions or need assistance, we are here 24/7 to help! You can submit a ticket, chat live with us, or call us at 1-604-265-0333 or 1-866-886-NSIX (Toll-Free)

Visit our support page, N6 cloud hosting knowledgebase: N6 Cloud!


Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 60