SSH Command to Connect to Server using Pem File Example

By Hardik Savani December 17, 2021 Category : Ubuntu

Hello all! In this article, we will talk about ssh command to connect to server using private key. i would like to show you how to ssh to remote server using a private key. This article will give you simple example of ssh command to connect to server using pem file. i explained simply step by step ssh pem file permissions. Let's get started with aws ssh pem file permissions.

If you need to connect your ec2 server or any remote server using pem file then i will give you simple command to connect as bellow:


ssh -i private_file_path remote_username@remote_host

after fire this command, you have pem file and you can pass one more parameter here:

Give pem file permission:

chmod 400 ec2private.pem

ssh -i ec2private.pem root@

i hope it can help you...

Tags :