login to server using pem with ssh in ubuntu
login to server using pem with ssh in ubuntu

Hi Guys, Welcome to Proto Coders Point, In this Article will learn how to connect to debian ubuntu server with “SSH connection command” using local terminal.

Creating SSH Public and Private Key... x
Creating SSH Public and Private Key in Linux / Ubuntu

Let’s get started, Follow below Steps for ubuntu ssh login.

How to login using ssh command in ubuntu terminal using pem file

If you have .pem file then jump to step 3, else you need to convert ppk to pem follow all steps as below:

Step 1: Install putty tools on Debian ubuntu

Open Terminal in your computer, and install putty, as it is needed to convert ppk to pem in step 2.

sudo apt-get install putty-tools

Step 2: Convert ppk to pem using putty

Now, once you have successfully installed putty on your ubuntu local system, let’s convert ppk file to pem by using below cmd:

puttygen <ppkfilename>.ppk -O private-openssh -o <pemFileName>.pem

The above cmd, will create pem file, for better understanding check out below screenshot.

convert ppk to pem file
convert ppk to pem file

Here micro_key.pem is the file that got generated successfully.

ppk to pem convert

Step 3: change permission of pem file

You need to change the permission of the file to 400, means “user” with read only permission (4) and “group” & “other” with no permission (0). to use pem file.

change file access permission by below command:

chmod 400 <pemFileName>.pem

Step 4: ssh connect using pem file

Now connect to the ubuntu server using ssh with pem file, by using following command:

ssh -i <pemFileName>.pem serverusername@server-ip
connect to server using ssh on ubuntu
connect to server using ssh on ubuntu