i am also having the same problem like them but i am using root user to do ssh…
root@DESKTOP-V3IQLHT:~/.ssh# ssh -i .ssh/aws_key_pair.pem ubuntu@ec2-35.161.145.248 -L 8888:127.0.0.1:8888
ssh: Could not resolve hostname ~35.161.145.248: Name or service not known
root@DESKTOP-V3IQLHT:~# ls -a
. .. anaconda3 .bash_history .bashrc .bashrc-anaconda3.bak downloads id_rsa_1 .local .nano .profile .ssh
root@DESKTOP-V3IQLHT:~# clear
root@DESKTOP-V3IQLHT:~# ls -a
. .. anaconda3 .bash_history .bashrc .bashrc-anaconda3.bak downloads id_rsa_1 .local .nano .profile .ssh
root@DESKTOP-V3IQLHT:~# cd .ssh/
root@DESKTOP-V3IQLHT:~/.ssh# ls
aws_key_pair.pem id_rsa_1.pub
What Should i do?
@ramesh
Update
ssh is successful with this one though
root@DESKTOP-V3IQLHT:~# ssh -i .ssh/aws_key_pair.pem ubuntu@ec2-54-70-111-75.us-west-2.compute.amazonaws.com