简体   繁体   中英

Public key error connecting to AWS EC2 Ubuntu instance on Mac with .pub file, username and host name

I am a newbie to AWS and need some help. I have a .pub file, a host name and username. I have been trying to connect to the server, but keep getting a Permission denied (publickey) error. Someone else set up the instance.

The .pub file is on my desktop. I am in desktop in my directory. Did chmod 400 to the .pub file. I then try: ssh -i /Users/machine/Desktop/filename.pub ubuntu@placeholder.com

Please let me know if you have any suggestions.

Thanks!

您需要私钥才能连接到EC2。

ssh -i /path/my-key-pair.pem ec2-user@ec2-198-51-100-1.compute-1.amazonaws.com

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM