Im trying to connect to my EC2 instance with SSH and Iḿ getting crazy. I have read this post and tried all user combinations:
AWS ssh access 'Permission denied (
Another thing to check is PermitRootLogin
and AllowUsers
in /etc/ssh/sshd_config
.
This debug1: key_parse_private2: missing begin marker
appears even after successful key authorization if your user access restricted.
You are probably logging in as the wrong user. If it's a Ubuntu instance the command would be:
ssh -v -i ec2-key-pair.pem ubuntu@ec2-54-72-242-0.eu-west-1.compute.amazonaws.com
I had a similar issue, "key_parse_private2: missing begin marker" while using username 'ec2-user' but it got fixed when I changed to ubuntu as the user.