Connecting to your EC2 Linux Instance from OSX/Linux:
Open a command-line shell, change directories to the location of the private key file that you created when you launched the instance.
Next you will need to change the permissions of the private key. You can do this by typing the following command:
sudo chmod 600 <name_private_key.pem>
Which can be for example:
sudo chmod 600 ClouderaCluster.pem
If your current directory is not where your private key is located, you need to type in the full path to your private key.
Now you can SSH into the machine by typing:
SSH ubuntu@<your-EC2-IP-address> -i <name_private_key.pem>
Which can be for example:
SSH [email protected] -i ClouderaCluster.pem
If prompted "Are you sure that you want to continue?", enter "yes".