How I lost enough time to be able to understand what was wrong or missing I decided to write this post. Also, I didn’t find a practical material.
You need a pair key
You need to create a key that must be saved in your computer to use to have access. You will set up it when you launch your instance. Important : You can’t change it after create your instance. This will be set in the last step.
- Go to : NETWORK & SECURITY >> Key Pairs >> Create Key Pair
- Save this key in your local environment ( Ex: ~/.ssh/my.pem )
- Use the chmod command to make sure your private key file isn’t publicly viewable.
chmod 400 ~/.ssh/my.pem
You need a security group that allow ssh
- Go to : NETWORK & SECURITY >> Security Groups >> Create Security Group
- In your group you must add the role : SSH allowed
EC2 – Launch your instance with the configs
- Go to : Instances >> Launch Instance
- Set up the security group :
- Set up the key pair : ( It is in the end after Launch Button )
Now you can do the SSH
ssh -i /path/my.pem publicDNS
+ Info :