Generate SSH Key on Linux

It's very easy to generate a ssh key on Linux!

Execute the following command to generate a SSH key

$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/sample/.ssh/id\_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/sample/.ssh/id\_rsa. Your public key has been saved in /home/sample/.ssh/id\ The key fingerprint is: xxxxxxxxxxxxxxxxxxxxxxxxxx [email protected] The key's randomart image is: +--[ RSA 2048]----+ | E. ..o | | . .. o | | o . . o | | . . = | | S ..o= | | ..=ooo | | .oo . | | . .. o | | o+o . .| +-----------------+

The public and private keys will be saved in ~/.ssh/id\_rsa (PRIVATE KEY) and ~/.ssh/id\ (PUBLIC KEY)

Copy the output from id\, for example you can use cat/nano/vim:

$ cat /home/sample/.ssh/id\ ssh-rsa sampleeeeeeeeeeeee [email protected]

  1. Open cPanel

  2. Click on SSH Remote Access

  3. Then go to Manage SSH Keys

  4. Click on Import Key

  5. Type name for public key (For example: MyKey1)<

  6. Scroll down and paste the public key into “Paste the public key into the following text box:”

  7. Click Import

  8. Back to Manage Keys

  9. Click on Manage on your public key and then Authorize

Now, you can access SSH on the server to which you are trying to connect without password authentication

$ ssh putty@servername -p4747