Knowledgebase: Shared Linux Hosting
SSH Access
Posted by Madhusudan S on 18 May 2015 01:35:37 PM

What is Secure Shell (SSH)?

Secure Shell (SSH) is a cryptographic network protocol for secure data communication, remote shell services or command execution and other secure network services between two networked computers that connects, via a secure channel over an insecure network, a server and a client (running SSH server and SSH client programs, respectively). SSH is typically used to log into a remote machine and execute commands. It can transfer files using the associated SSH file transfer (SFTP) or secure copy (SCP) protocols. The standard port used to connect through SSH is 22.

Enabling SSH Access

We supports SSH access on all its Linux (Single Domain, Multi Domain and Reseller) Hosting Servers. SSH Access will be enabled for a cPanel Account on request. You may contact our Support Team to have the access enabled.

Connecting to a Server through SSH

SSH connection to Linux Hosting Servers will be through a key based authentication.

Generating a SSH Key Pair

The user needs to generate key (public key and private key) pair on his local computer.

For Linux:

Run the below command:

OR

ssh-keygen -t rsa

The output would be similar to:

Generatingpublic/private dsa key pair.Enter file in which to save the key (~/.ssh/id_dsa):Press[Enter] key 
Enter passphrase (empty forno passphrase):Press[Enter] key 
Enter same passphrase again:Press[Enter] key 
Your identification has been saved in~/.ssh/id_dsa 
Yourpublic key has been saved in~/.ssh/id_dsa.pub 
The key fingerprint is:<some string>

OR

Generatingpublic/private dsa key pair.Enter file in which to save the key (~/.ssh/id_dsa):Press[Enter] key 
Enter passphrase (empty forno passphrase):Press[Enter] key 
Enter same passphrase again:Press[Enter] key 
Your identification has been saved in~/.ssh/id_dsa 
Yourpublic key has been saved in~/.ssh/id_dsa.pub 
The key fingerprint is:<some string>

id_dsa or id_rsa is the private key and id_dsa.pub or id_rsa.pub is the public key.

For Windows:

  1. Download PuTTY.

  2. Download PuTTYgen.

  3. Open PuTTYgen.

  4. Select the SSH-2 RSA (or SSH-2 DSA) option and click the Generate button.

  5. Move mouse randomly over the empty space below the progress bar to create some randomness in the generated key.

  6. Click the Save private Key button, without providing any passphrase.

  7. Click Yes on the window asking for confirmation for saving the key without a password.

  8. Save the key file with an appropriate name, say ssh_private_key.ppk.

Authorize the SSH Server to use the Public Key

For Linux:

  • Create a directory as .ssh (note the preceding dot) under /home/<username>/ for your hosting package on the remote host. You will then have to create a file named authorized_keys inside this .ssh directory.

  • Copy the content of the local ~/.ssh/id_dsa.pub or ~/.ssh/id_rsa.pub file into the authorized_keys file.

For Windows:

  • Create a directory as .ssh (note the preceding dot) under /home/<username>/ for your hosting package on the remote host. You will then have to create a file named authorized_keys inside this .ssh directory.

  • Copy the content under the Public-Lines section in the file called ssh_private_key.ppk on the local computer.

  • Edit the authorized_keys file on the remote host, type the word ssh-rsa (including spaces on both ends of the word) and paste the copied content. Remove the carriage return at end of each line, merging four lines into one single line. Be careful not to delete any characters while doing that. Final output would be similar to:

    ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAnjXf5VEuIfOHmbNGn7NZAYDjSp8mYK9sDF+RZR75V4gyu3FeaXcAlwA/jwzzgpIvhK2why5t9DtokyInlocq
    P9SbNd9xOnrvXEV+ImvKiBf4+tFk7uagZJ+CLrr0tK7M4lKskjfad38UF5cJ0+YU24V1sCDs6QTJC4kG3PO1eeE=

Accessing the Remote Server

For Linux:

Run the below command:

ssh -l user remote-server

For Windows:

  1. Open Putty and enter the Remote Host Name or IP Address.

     

  2. In the left menu, click Data under Connection and enter the cPanel username in the Auto-login username field.

     

  3.  

    In the left menu, click Auth under Connection -> SSH and enter the path of the saved private key file.

  4. Click the Open button to connect to the server.

(0 vote(s))
Helpful
Not helpful