amazon-ebs: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain



  • Hi, when I run the following, it errors, any help would be appreciated.

    $ packer build dev_ami.json
    

    My json looks like this:

    {
      "variables": {
         "aws_access_key": "",
         "aws_secret_key": ""
      },
      "builders": [{
        "type": "amazon-ebs",
        "access_key": "{{user `aws_access_key`}}",
        "secret_key": "{{user `aws_secret_key`}}",
        "region": "eu-west-1",
        "source_ami": "ami-ca0135b3",
        "instance_type": "t2.micro",
        "ssh_username": "ubuntu",
        "ami_name": "packer-dev-master {{timestamp | clean_ami_name}}"
       }]
    }
    

    Error:
    ==> Some builds didn't complete successfully and had errors:
    --> amazon-ebs: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain



  • @hawksbill : I looked up the ami-ca0135b3 and its not an ubuntu ami, so that's why you are seeing the error, change the ssh_username or the ami-id to match OS with user.



  • @mountaing : yep, that was the error, thanks a lot for the help! :)


Log in to reply
 

© Lightnetics 2024