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\_rsa.pub. 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\_rsa.pub (PUBLIC KEY)
Copy the output from id\_rsa.pub, for example you can use cat/nano/vim:
$ cat /home/sample/.ssh/id\_rsa.pub ssh-rsa sampleeeeeeeeeeeee [email protected]
-
Open cPanel
-
Click on SSH Remote Access
-
Then go to Manage SSH Keys
-
Click on Import Key
-
Type name for public key (For example: MyKey1)<
-
Scroll down and paste the public key into “Paste the public key into the following text box:”
-
Click Import
-
Back to Manage Keys
-
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
Updated 4 months ago