Each AMI publisher on EC2 sets a default username for the AWS credentials that must be used to access Linux distributions of EC2 using SSH. This post describes all the default usernames in AWS to login, such as EC2.
Default usernames in AWS
RHEL | ec2-user |
Debian | admin |
Ubuntu | ubuntu |
Fedora | fedora |
Amazon Linux | ec2-user |
SUSE | root |
Centos | centos |
BitNami | bitnami |
TurnKey | root |
NanoStack | ubuntu |
OmniOS | ec2-user |
FreeBSD | ec2-user
|
Thus, as defined above, you must use the default username to log in to the corresponding operating system or distribution.
- Login to RHEL using the default “EC2-user”
For example. To log in to RHEL ec2, you must use the default AWS username “EC2-user”. Once logged in, you must use the sudo command for root user to perform admin tasks as shown below:
login as: ec2-user Authenticating with public key "imported-openssh-key" Last login: Thu Mar 18 10:10:35 2017 from 111.214.23.32 [[email protected] ~]$ [[email protected] ~]$ [[email protected] ~]$ sudo su - Last login: Mon May 1 09:21:14 EDT 2017 from 111.214.23.32 on pts/0 [[email protected] ~]# uname -a Linux ip-213-159-209-228.ap-south-1.compute.internal 3.10.0-327.10.1.el7.x86_64 #1 SMP Wed Mar 10 10:34:12 EST 2016 x86_64 x86_64 x86_64 GNU/Linux [[email protected] ~]#
- Login to Ubuntu using the default user “Ubuntu”
Likewise, you must use the default “Ubuntu” user to login, for example Ubuntu EC2, and then “use sudo su -” for further administrator tasks.
login as: ubuntu Authenticating with public key "imported-openssh-key" Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-1013-aws x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage Get cloud support with Ubuntu Advantage Cloud Guest: https://www.ubuntu.com/business/services/cloud 0 packages can be updated. 0 updates are security updates. Last login: Thu Mar 18 14:10:15 2017 from 111.214.32.32 [email protected]:~$ sudo su - [email protected]:~# uname -a Linux ip-213-159-209-228 4.4.0-1013-aws #22-Ubuntu SMP Fri Mar 31 15:41:31 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux [email protected]:~#
In the same way, you can use the default username in AWS described in the “Default usernames in AWS” section of the table.