Application for Amazon Cloud Server EC2, instance for Ubuntu system
First, open the terminal, locate the folder where the key is placed;
Second, ensure that the private key is not publicly visible:
chmod 400 key file name. PEM
Three, two ways to connect to the cloud server: (assuming that the instance of the public IP is: 11.22.33.44)
Ssh-i key file name. PEM [email protected]
Ssh-i key file name. PEM [email protected]
Both of these methods are error:
Permission denied (PublicKey).
Iv. Solutions:
The following paragraph is in the official Amazon documentation:
Get The default user name for the AMI so used to launch your instance
For a 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 a RHEL AMI, the user name is ec2-user
or root
.
For a SUSE AMI, the user name is ec2-user
or root
.
For a Ubuntu AMI, the user name is ubuntu
or root
.
Otherwise, if ec2-user
and root
don ' t work, check with the AMI provider.
The last one shows the use of ec2-user and root can not connect, so need to try a bit more, because I installed the Ubuntu system, the connection command directly into the Ec2-user Ubuntu, the perfect connection.
Mac Login Amazon Cloud Server error: Permission denied (publickey).