Question : Connect to EC2 instance / server via CLI / ssh
Answered by : splendid-skipper-8yz995le7djw
//First move the private key file ending with .pem extension to ~/.ssh folder
mv Downloads/file.pem ~/.ssh/
//then change its permissions to avoid a certain error at ec2 console
chmod 400 .ssh/file.pem
//Now final command to connect as ec2 user
ssh -i ~/.ssh/file.pem ec2-user@ipOfInstance
Source : | Last Update : Sat, 13 May 23