Jump to content

Recommended Posts

  • Superior Administrator
Posted

This has proven more secure over standard username/password authentication.

You can generate an SSH key pair directly in cPanel, or you can generate the keys yourself and just upload the public one in cPanel to use with your hosting account.

When generating SSH keys yourself under Linux, you can use the ssh-keygen command. To do so follow these steps:

  • Open up the Terminal
  • Type in the following command:

 

[iCODE]ssh-keygen -t rsa[/iCODE]

 

  • Next you will have to type in the location of the file where you would like to save the private key.

 

Enter file in which to save the key (/home/youruser/.ssh/id_rsa):

The public key will be saved in the same location, under the same file name, but with the .pub extension. Type in nothing to use the default location, which is /home/youruser/.ssh/id_rsa.

 

  • Finally you will have to type in a password. This will be the password required to load the private key and use it to connect via SSH later on:

[iCODE]Enter passphrase (empty for no passphrase):[/iCODE]

The entire key pair generation process would look like this:

 

user@localhost: ssh-keygen -t rsa

Generating public/private rsa key pair.

Enter file in which to save the key (/home/youruser/.ssh/id_rsa):

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in id_rsa.

Your public key has been saved in id_rsa.pub.

The key fingerprint is:

16:8e:e8:f2:1d:c9:b9:cf:43:9a:b3:3c:c1:1f:95:93 user@localhost

This will create a private key written to /home/youruser/.ssh/id_rsa and a public key written to /home/youruser/.ssh/id_rsa.pub.

The private key needs to be loaded in your Terminal using the ssh-add command:

 

[iCODE]ssh-add /home/youruser/.ssh/id_rsa[/iCODE]

After which you will be asked to enter the passphrase of your key.

  • Like 1
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...
×
GloTorrents Community Forum
Home
Activities
Sign In
Search
More
×