Connect to EC2 with .PEM file

0

Hi guys! Can someone help me how to connect to my EC2 server with a .PEM file? I have had an EC2 running for several years and I remember that usually I was connecting through a .PEM file that I have on my computer. Now for some reason I can´t find the way to do the same thing. I dont know if the system changed or its just me being super noob. If anyone could help I would greatly appreciate. Thank you!

gefragt vor einem Jahr6815 Aufrufe
2 Antworten
3

if you are using Linux

ssh -i /path/to/your/pemfile.pem ec2-user@your-ec2-public-dns

if you are using Windows you can use the following command in PowerShell with the OpenSSH client

ssh -i "C:\path\to\your\pemfile.pem" ec2-user@your-ec2-public-dns

Or with putty

you'll first need to convert the .PEM file into a .PPK file To convert the .pem file to .ppk file you need puttygen.exe

  • Run PuTTYgen, and click on the "Load" button to import your .PEM file. Make sure to change the file type to "All Files (.)" in the file dialog so that you can see your .PEM file.
  • Once the .PEM file is loaded, click on the "Save private key" button to save the private key as a .PPK file. You can choose a name and location for the .PPK file. It's a good idea to store it in a safe location.

Noe Open putty

  • enter the public DNS or the public IP address of your EC2 instance in the "Host Name (or IP address)" field.
  • In the left-side category pane, navigate to "Connection" > "SSH" > "Auth". In the "Private key file for authentication" section, click the "Browse" button and locate the .PPK file you saved in step 3.
  • Go back to the "Session" category in the left-side pane, and you can save your session settings by entering a name in the "Saved Sessions" field and clicking the "Save" button. This way, you won't have to reconfigure the settings every time you want to connect to your EC2 instance.
profile picture
EXPERTE
beantwortet vor einem Jahr
1

Please check this document.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/openssh.html

Connecting using OpenSSH by specifying .pem in the command.

ssh -i /path/key-pair-name.pem instance-user-name@instance-public-dns-name
profile picture
EXPERTE
beantwortet vor einem Jahr

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen