Connect to an AWS Instance Via SSH: Difference between revisions

From Cramsession
Jump to navigationJump to search
✍️ Verified Author: MflavellClick to view professional profile & credentials
(Created page with " = Create and Download a .PEM file for the instance = Follow the instructions by Amazon https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/connect-linux-inst-ssh.html = Make sure you are using the right username = For Amazon Linux 2 or the Amazon Linux AMI, the username is ec2-user. For a CentOS AMI, the user name is centos. For a Debian AMI, the user name is admin. For a Fedora AMI, the user name is ec2-user or fedora. For a RHEL AMI, the user name is ec2-user or...")
 
No edit summary
Line 9: Line 9:
= Make sure you are using the right username =
= Make sure you are using the right username =


For Amazon Linux 2 or the Amazon Linux AMI, the username is ec2-user.
For Amazon Linux 2 or the Amazon Linux AMI, the username is ec2-user.  
For a CentOS AMI, the user name is centos.
For a CentOS AMI, the user name is centos.
For a Debian AMI, the user name is admin.
For a Debian AMI, the user name is admin.
For a Fedora AMI, the user name is ec2-user or fedora.
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 RHEL AMI, the user name is ec2-user or root.
For a SUSE 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.
For a Ubuntu AMI, the user name is ubuntu.
For an Oracle AMI, the user name is ec2-user.
For an Oracle AMI, the user name is ec2-user.
For a Bitnami AMI, the user name is bitnami.
For a Bitnami AMI, the user name is bitnami.
Otherwise, if ec2-user and root don't work, check with the AMI provider.
Otherwise, if ec2-user and root don't work, check with the AMI provider.


= try to connect =
= try to connect =


ssh -i '''your_key'''.pem  '''username'''@'''ip address'''
ssh -i '''your_key'''.pem  '''username'''@'''ip address'''

Revision as of 23:09, 9 March 2025

Create and Download a .PEM file for the instance

Follow the instructions by Amazon

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/connect-linux-inst-ssh.html


Make sure you are using the right username

For Amazon Linux 2 or the Amazon Linux AMI, the username is ec2-user. 
For a CentOS AMI, the user name is centos.
For a Debian AMI, the user name is admin.
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.
For an Oracle AMI, the user name is ec2-user.
For a Bitnami AMI, the user name is bitnami.
Otherwise, if ec2-user and root don't work, check with the AMI provider.

try to connect

ssh -i your_key.pem username@ip address