It was necessary to make some changes on the Amazon AWS EC2 server, the client provided me with a ppk (PuTTY private key file) file to access the server via the ssl. But, since I am a Debian user, this file does not suit me. Therefore, I converted it to pem-format using the following commands:
First 1, install tools
sudo apt-get install putty-tools
Step 2, Now, convert the ppk file to pem file using puttygen command line tool.
puttygen server.ppk -O private-openssh -o server.pem
Step3, Change the .pem file permissions. Set the read-only permissions to the owner of the file, remove any permission to group and other. Otherwise ssh will refuse this key for use.
$ chmod 400 server.pem
Step 4, Finally, connect to your remote Linux server with ssh using this pem key
ssh -i server.pem [email protected]
P.S. For Amazon AWS. Verify that you are connecting with the appropriate user name for your AMI
The appropriate user names are as follows:
- 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
orroot
. - For a Fedora AMI, the user name is
ec2-user
orfedora
. - For a RHEL AMI, the user name is
ec2-user
orroot
. - For a SUSE AMI, the user name is
ec2-user
orroot
. - For an Ubuntu AMI, the user name is
ubuntu
. - Otherwise, if
ec2-user
androot
don’t work, check with the AMI provider.
P.P.S. To avoid problems. Use Public DNS instance name instead of Public IP
Similar Posts:
- How to check mailserver ssl certificate and expiration date
- how to install sshpass on Windows (cygwin)