简体   繁体   中英

rsa public key to pem

Someone gave me the following, how can I save it in a format that will be usable inside putty.

AWS EC2 Instance Details

OS Amazon Linux 2 AMI (HVM)

Address ec2-18-22126.us-east-2.come.amazonaws.com

Type t2.micro, 8GB SSD

Public IP Enabled

AZ Subnet us-east-2a

Open Inbound Ports TCP: 22, 80, 45

PEM File Contents -----BEGIN RSA PRIVATE KEY----- MIIEowIBAAKCAQEAixAXtfluuAgavE/RMh3bOTSIyf8gRhozDOoZlE6k2zEU2EB1va5b8avzB+nQ VsHQpAuqrjOJ44RQQZIe3s IxQyV8fs4s4MiRTjsYiLn8lS8g2rgYCUH1r/9UOrAIunbnHX/vbJl2Bub1I7C+yQ4mrL -----END RSA PRIVATE KEY-----
  1. Download Puttygen from here .
  2. Open puttygen.exe Click load.
  3. select PEM file.
  4. Save as private key.

NOTE: AWS Docs will say everything and never share the PEM keys here.

It's straightforward.

Before you connect to your Linux instance using PuTTY, complete the following prerequisites:

Install PuTTY

Download and install PuTTY from the PuTTY download page . If you already have an older version of PuTTY installed, we recommend that you download the latest version. Be sure to install the entire suite.

Get the ID of the instance

You can get the ID of your instance using the Amazon EC2 console (from the Instance ID column). If you prefer, you can use the describe-instances (AWS CLI) or Get-EC2Instance (AWS Tools for Windows PowerShell) command.

Get the public DNS name of the instance

You can get the public DNS for your instance using the Amazon EC2 console (check the Public DNS (IPv4) column; if this column is hidden, choose the Show/Hide icon and select Public DNS (IPv4)). If you prefer, you can use the describe-instances (AWS CLI) or Get-EC2Instance (AWS Tools for Windows PowerShell) command.

(IPv6 only) Get the IPv6 address of the instance

If you've assigned an IPv6 address to your instance, you can optionally connect to the instance using its IPv6 address instead of a public IPv4 address or public IPv4 DNS hostname. Your local computer must have an IPv6 address and must be configured to use IPv6. You can get the IPv6 address of your instance using the Amazon EC2 console (check the IPv6 IPs field). If you prefer, you can use the describe-instances (AWS CLI) or Get-EC2Instance (AWS Tools for Windows PowerShell) command. For more information about IPv6, see IPv6 Addresses.

Locate the private key

Get the fully qualified path to the location on your computer of the .pem file for the key pair that you specified when you launched the instance.

Get the default user name for the AMI that you used to launch your instance

For Amazon Linux 2 or the Amazon Linux AMI, the user name is ec2-user.

For a Centos AMI, the user name is centos.

For a Debian AMI, the user name is admin or root.

For a Fedora AMI, the user name is ec2-user or fedora.

For an RHEL AMI, the user name is ec2-user or root.

For a SUSE AMI, the user name is ec2-user or root.

For an Ubuntu AMI, the user name is Ubuntu.

Otherwise, if ec2-user and root don't work, check with the AMI provider.

Enable inbound SSH traffic from your IP address to your instance

Ensure that the security group associated with your instance allows incoming SSH traffic from your IP address. The default security group does not allow incoming SSH traffic by default. For more information, see Authorizing Inbound Traffic for Your Linux Instances.

For more read the following page on AWS:

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM