•  Home
  •  Dashboard
  •  Services
    • Dedicated Servers
    • Colocation
    • Private Cloud
    • DDoS Protection
    • IP Transit
    • Backup
    • CDN
    • GGA
  •  Solutions
    • Ecommerce
    • Security
    • Gaming
    • Hosting
    • Management
    • Finance
    • System Integrator
  •  Support
    • Knowledgebase
    • Community
    • Open Ticket
  •  Company
    • About Us
    • Contact Us
    • Network
    • Data Centers
    • Looking Glass
    • Affiliates
    • Reseller
    • Blog
  • Services
    • Dedicated Servers
    • Colocation
    • Private Cloud
    • DDos Protection
    • IP Transit
    • CDN
    • GGA
    • Backup
  • Solutions
    • Ecommerce
    • Security
    • Gaming
    • Hosting
    • Management
    • Finance
    • System Integrator
  • Dashboard

Generate SSH Key

Trusted By
25,000+ Customers (Since 2001)
  • 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

  • Unable to Access The Server Via SSH
  • Create SSH Key
  • How to remotely connect to a Linux machine using a smartphone?
  • SSH Reverse Tunnel
  • SSH File Transfer
  • SSH Agent Forwarding
  • Enable SSH Ubuntu
  • How To Secure cPanel?
  • ssh host key verification failed error
  • How To Setup Application Load Balancer Using CDN
  • CDN and Load Balancer: Ultimate combination for efficient content delivery
  • How to install the GCC compiler in CentOS 7?
  • What Scientific Linux is and its features
  • Top Encryption Software For Linux
  • Scientific Linux and its features
Hosting Services
  • Dedicated Hosting
  • Colocation Hosting
  • Backup
  • IP Transit
  • DDoS Mitigation
Support
  • Portal Login
  • Knowledgebase
  • Community
Company
  • About Us
  • Contact Us
  • Network
  • Data Centers
  • Looking Glass
  • Affiliates
  • Reseller
  • Blog
Policies
  • Privacy Policy
  • Acceptable Usage Policy
  • Terms and Conditions
  • Service Level Agreement
Company
  • Psychz Networks,
    A Profuse Solutions Company
    611 Wilshire Blvd #300
    Los Angeles,California 90017
    USA
  • US/Canada: 800-933-1517
  • International: 626-549-2801
Subscribe to Our Mailing List
* indicates required
Copyright © 2021 Psychz Networks, A Profuse Solutions Inc Company