The access to the instance is managed by the default security group, given that the instance was created with all the default wizard suggestions. The default security group will prohibit all the inbound traffic. In order to make your instance accessible, you will have to create a new rule in the security group.
Following is how you do that:
1. Go to your AWS Console
2. Go to the security Groups on the menu on the left.
3. Select the default security group
4. In the bottom pane, select inbound and then create a new rule: SSH. Click on ADD rule.
Assuming that you have the keypair of the instance, perform the following:
$ chmod 600 path/to/keypair_name.pem
$ ssh -i path/to/keypair_name.pem [email protected]
if you are working on Ubuntu instance, replace "root" with "ubuntu" so the above command looks like:
$ ssh -i path/to/keypair_name.pem [email protected]