First configure the SSH access on Server
- In the home page of cPanel go to “SSH Access”
- Click “Manage SSH keys”
- Click “Generate Key”
- Set a key name and set the key password(this is the passphrase to connect to the server). Leave the others fields with the data by default
- Click “Generate Key”
- On “Manage SSH Keys” select “Manage” in the new key generated
- Click “Authorize”
- On “Manage SSH Keys” select “View/Download” on “Private Keys”
- Click “Download Key” and save the file as “keyname.key”
- Move the downloaded key to a folder where you store your keys, example: ~/.ssh
- Change the permission of the copied file to 600 with the chmod command
- In the home page of cPanel go to “Manage SSH”
- Enable the option “Enable SSH access”
Let’s configure the SSH connection on the machine. NOTE: This example apply for Mac
Create a file called “config” on path ~/.ssh (you can pick whatever you want)
Host hostname HostName IP Address/Hostname User username Port 9999 IdentityFile ~/.ssh/name.key
Now to connect to the server on console write:
ssh hostname
Then the console will ask you the passphrase that was set in the fourth step when we create the key on the beginning of the post