sudo chmod -R 700 file_name.key
sudo chmod -R 700 your-key.pem
sudo chmod 600 ~/.ssh/<your key's name>
chmod 600 ~/.ssh/file.pem
Mac - [ec2-user ~]$ chmod 0400 .ssh/my_private_key.pem
Windows - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html#troubleshoot-unprotected-key
cp <path to your key> ~/.ssh/<name of your key>
ssh -i ~/.ssh/<name of your key> <username>@<ip address>