•  Home
  •  Dashboard
  •  Company
    • About Us
    • Blog
    • Careers
    • Contact Us
    • Data Centers
    • Looking Glass
    • Network
    • Reseller
  •  Hosting Services
    • Infrastructure
      • iColocation
    • Compute
      • cMetal
      • cVirtual
    • Storage
      • sObject
      • sBlock
    • Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • Protection
      • pBackup
      • pDDoS
  •  Solutions
    • Ecommerce
    • Finance
    • Gaming
    • Hosting
    • Management
    • Security
    • System Integrator
  •  Support
    • Community
    • Knowledge Base
    • Open A Ticket
  •  USA & Canada: 800-933-1517
  •  International: 626-549-2801
  •  Email: sales@psychz.net
  • Services
    • new-colocation-header-img
      Infrastructure
      • iColocation
    • new-compute-header-img
      Compute
      • cMetal
      • cVirtual
    • new-storage-header-img
      Storage
      • sObject
      • sBlock
    • new-networking-header-img
      Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • new-protection-header-img
      Protection
      • pBackup
      • pDDoS
  • Solutions
    • Ecommerce
    • Security
    • Gaming
    • Hosting
    • Management
    • Finance
    • System Integrator
  • Dashboard

Generate SSH Key

  • Home
  • Client
  • Qa Forum
  • Generate SSH Key

Posted By: Gabe | 1 Replies | Last Reply On: Oct 10, 2017 21:42:58

How can i generate SSH key and set it up so I can use it instead of password? 

Psychz - Nikhil

Votes: 0Posted On: Oct 10, 2017 21:42:58
 

SSH keys provide a secure way for connecting to a remote server. We know that SSH is one of the more important methods used to connect to a remote server. The SSH keys are used to establish a secure connection between the local and remote host. After setting up the SSH key, you can connect to the remote server without the password as the SSH key is secure enough and troublesome to decipher. In this article, we will discuss the setting up of SSH key pair on Ubuntu version 14.04.

Here are the steps to establish a secure connection through the SSH keys. 

 

Create the RSA Key Pair

1. Use the following command to create an SSH key pair on your system which you will later copy onto the remote server.

 

ssh-keygen -t rsa

 

2. The system will then prompt you to enter the location in which you want to save the key. If you press enter without entering any location, it will store the key in the default path i.e "/home/current_user/.ssh/id_rsa". 

3. Once the file is saved, a prompt will be displayed asking for a passphrase. The passphrase is another level of authentication and you will have to enter the passphrase every time you establish a connection. If you don't want a passphrase, leave the field empty.

The public key is now located in "/home/current_user/.ssh/id_rsa.pub" and the private key in "/home/current_user/.ssh/id_rsa".


Copying the SSH key to the Remote host

You know have to copy the SSH public key to the remote host. This can be achieved in multiple ways.

1. You can use the following command to copy the key to the remote host. 

 

ssh-copy-id username@IP_address

 

2. You can also use ssh to copy the key to the desired directory. 

 

cat ~/.ssh/id_rsa.pub | ssh username@IP_address "mkdir -p ~/.ssh && cat >>  ~/.ssh/authorized_keys"

 

 

Disable Password for Root Login

1. The SSH configuration file is stored in "/etc/ssh/sshd_config". Please edit the file with any editor of your choice like nano, vi etc. 
We are using the vi editor in this case. 

 

sudo vi /etc/ssh/sshd_config

 

2. The file includes a line "PasswordAuthentication". Please uncomment it by removing the "#" symbol. Then edit the file as shown below.

PasswordAuthentication no

 

3. Restart the SSH services for the changes to take effect.

 

service sshd restart(For Centos operating system)
sudo systemctl restart ssh(For Ubuntu operating system)

Was this reply helpful?

Related topics

  • How to generate SSH Keys on Linux?
  • Create SSH Key
  • Unable to Access The Server Via SSH
  • How to remotely connect to a Linux machine using a smartphone?
  • SSH Reverse Tunnel
  • SSH File Transfer
  • SSH Agent Forwarding
  • SSH Keys - Create
  • cVirtual Connect from Windows
  • SSH into Docker Container
  • Best 10Gbps Unmetered Dedicated Server In North America - Top 10 List
  • Best 10Gbps Unmetered Dedicated Servers - Top 10 List
  • Best Dedicated Server Providers in Los Angeles: Top 10 List
  • Best Dedicated Server Providers In Dallas: A Comprehensive Guide
  • Psychz CDN Products and Features Updates
Copyright © 2025 Psychz Networks,
A Profuse Solutions Inc Company
Hosting Services
Infrastructure
  • iColocation
Compute
  • cMetal
  • cVirtual
Storage
  • sObject
  • sBlock
Networking
  • nCDN
  • nIP Transit
  • nWavelength
Protection
  • pBackup
  • pDDoS
Company
  • About Us
  • Blog
  • Careers
  • Contact Us
  • Data Centers
  • Looking Glass
  • Network
  • Reseller
Policies
  • Acceptable Usage Policy
  • Privacy Policy
  • Service Level Agreement
  • Terms and Conditions
Support
  • Community
  • Knowledge Base
  • Open A Ticket
Get In Touch
  • Psychz Networks,
    A Profuse Solutions Company
    611 Wilshire Blvd #300
    Los Angeles,California 90017
    USA
  • US/Canada: 800-933-1517
  • International: 626-549-2801