I've read AWS docs which says I should use:
ssh -i /path/my-key-pair.pem my-instance-user-name@my-instance-public-dns-name
but I have no idea what my-instance-user-name
should be.
For Ubuntu I always do
ssh -i /path/my-key-pair.pem ubuntu@my-instance-public-dns-name
after changing permissions of my key via chmod 400 /path/my-key-pair.pem
CodePudding user response:
For Redhat (RHEL) it will be ec2-user
. For other OS, the list is here:
For Amazon Linux 2 or the Amazon Linux AMI, the user name is ec2-user.
For a CentOS AMI, the user name is centos or ec2-user.
For a Debian AMI, the user name is admin.
For a Fedora AMI, the user name is fedora or ec2-user.
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 an Ubuntu AMI, the user name is ubuntu.
For an Oracle AMI, the user name is ec2-user.
For a Bitnami AMI, the user name is bitnami.
Otherwise, check with the AMI provider.