SSH to Amazon EC2 instance using Putty in windows

I am a newbie to Amazon web services, was trying launch an Amazon instance and ssh to it using putty from windows. These are the steps I followed,

  • Created a key pair.

  • Created security group with rule for SSH and HTTP.

  • Launched and instance of EC2 using the above key pair and security group.

  • Using puttygen converted the *.pem file to *.ppk

  • Using putty tried connecting to the public dns of the instance and provided the *.ppk file.

  • I logged in using 'root' and 'ec2-user', and created the ppk file using SSH1 and SSH2, for all these attempts I get the following error in putty,

    "Server refused our key"

    Can you guys please help, any suggestions would be greatly appreciated.


    我假设OP计算出来或以其他方式移动,但答案是使用ubuntu作为用户(如果服务器是Ubuntu)。


    1) Make sure you have port 22 (SSH) opened in Security Group of EC2 Instance.

    2) Try connecting with Elastic IP instead of public DNS name.

    I hope you have followed these steps Connecting EC2 from a Windows Machine Using PuTTY


    Another situation where I got the "Server refused our key" error when using putty, from windows, to ssh to an EC2 instance running ubuntu:

    The private key was wrongly converted from .pem to .ppk.

    puttygen has two options for "converting keys".

  • Load your .pem file into puttygen using the File->Load Private Key option and then save as .ppk file using the Save Private Key Button.
  • DO NOT use the menu option Conversions->Import Key to load the .pem file generated by EC2.

    See the puttygen screenshots below, with the two menu options marked.

  • 用puttygen修正菜单选项用puttygen拧上菜单选项

    链接地址: http://www.djcxy.com/p/38970.html

    上一篇: 使用scp将文件复制到Amazon EC2实例?

    下一篇: 在Windows中使用Putty SSH到Amazon EC2实例