Login with an SSH Private key in Linux or Mac Terminal

by | Apr 19, 2017 | Howtos, Linux | 0 comments

First you need following things :

  • generate private key from your hosting site ( i used godaddy cpanel )
  • username of cpanel
  • password of cpanel
  • finally passphrase which you have given when creating private key

Download your private key from your hosting site to your desktop , i have download my key from godaddy cpanel , you can find a file named ” newssh ” which is a private ssh key * name of private may vary

i have renamed the file ” newssh ” to ” newssh.txt ” , i have just changed the file extension , so that it can readable by terminal or you can read it using any text based editor like vim , nano or gedit

now you need to move this file from Desktop to your Home Directory , because when you open your directory it will mount home as the default directory

now you can see the ” newssh.txt ” file is listed in the terminal home directory

Run the following command to change the file permissions to 600 to secure the key. You can also set them to 400. *This step is required:


chmod 600 newssh.txt


To login you need to type the following details in the terminal , which loads the key in file newssh.txt and logs in as user ,to IP your server ip


ssh -i newssh.txt [email protected]


then press Enter key , now it will ask you for the passphrase which you have given at the time for private key creation , type the passphrase  , Press Enter



Congratulation you have successfully login to your server using ssh




Written By George Sruthin

Founder of techridez.com, a Network Consultant, a tech blogger, Loves Web Designing.

Related Posts




Submit a Comment

Subscribe For Instant News, Updates, and Discounts

Pin It on Pinterest

Share This