Can't ssh to AWS EC2: Identity file not accessible

前端 未结 14 872
予麋鹿
予麋鹿 2021-02-02 06:08

I\'m unable to ssh to my EC2 server and am getting the error:

ssh -i /Users/Skeniver/Keepass/skeniver.pem ubuntu@xx.xxx.xx.xxx

Identity file /Users/Skeniver/Kee         


        
相关标签:
14条回答
  • 2021-02-02 06:27

    my solution is move it to the path which is all the english chars

    (i am a chinese, and use the chinese windows, when i run the command from the path which contains the chinese chars, it will return "Warning: Identity file debao-visa.pem not accessible: No such file or directory.")

    0 讨论(0)
  • 2021-02-02 06:28

    I had the same problem and i found that the issue with the file path. Right click on the your key_pair.pem (identical file) go the properties and copy and now your comment is like

    ssh -i /path/skeniver.pem user@your_public_ip
    

    for example in my case command like

    ssh -i /home/anil/.ssh/webKey.pem ec2-user@ec2-45-349-50-38.us-west-2.compute.amazonaws.com
    
    0 讨论(0)
  • 2021-02-02 06:34

    You need the identity file to login to the box. Use the command

    ssh -i (identity_file) username@hostname
    
    0 讨论(0)
  • 2021-02-02 06:37

    chmod 600 ~/.ssh/public_key_file solved for me

    0 讨论(0)
  • 2021-02-02 06:38

    run the command from .ssh directory i.e/Users//.ssh and then execute the command ssh -v -i @

    this worked for me after many failed attempt.

    note: please make sure .pem file has necessary permission chmod 400 <.pem file> before executing the command

    0 讨论(0)
  • 2021-02-02 06:40

    For your case just

    just execute the following command to change permission

    sudo chmod 400 /Users/Skeniver/Keepass/skeniver.pem

    and then execute the command that will connect you to EC2

    ssh -i /Users/Skeniver/Keepass/skeniver.pem ubuntu@xx.xxx.xx.xxx

    0 讨论(0)
提交回复
热议问题