Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amazon-ebs builder seems to ignore ssh_password #3156

Closed
SanderKnape opened this issue Feb 6, 2016 · 2 comments · Fixed by #3953
Closed

amazon-ebs builder seems to ignore ssh_password #3156

SanderKnape opened this issue Feb 6, 2016 · 2 comments · Fixed by #3953
Assignees

Comments

@SanderKnape
Copy link

I've uploaded a test AMI to AWS to which I can connect with both the ssh_username and ssh_password set to "vagrant". Spinning up an instance and connecting with it using these credentials allows me to succesfully connect. Also, during the Packer build phase, I can connect with the machine using these credentials.

However, packer itself seems to ignore the ssh_password, as the error I'm getting is as follows:

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

Also, a quick look through Packer source tells me that password-based SSH authentication is never configured. Though it's very possible I'm not looking at the correct code.

The following is the setup of my builder:

{
    "type": "amazon-ebs",
    "access_key": "{{user `aws_access_key`}}",
    "secret_key": "{{user `aws_secret_key`}}",
    "region": "eu-west-1",
    "source_ami": "ami-ebe95898",
    "instance_type": "t2.micro",
    "communicator": "ssh",
    "ssh_username": "vagrant",
    "ssh_password": "vagrant",
    "ami_name": "packer-example {{timestamp}}"
}

Am I correct in concluding that my ssh_password is never used? Is this a missing feature? I'm fully aware of the security implications of using password-based SSH authentication and don't plan to use this in any production environment, but was hoping to quickly get something up and running.

@jjduhamel
Copy link

I'm having a similar issue building from an image with pam_duo installed. I think keyboard-interactive mode needs to be added to the amazon-ebs builder.

https://github.com/mitchellh/packer/search?utf8=%E2%9C%93&q=PasswordKeyboardInteractive

rickard-von-essen added a commit to rickard-von-essen/packer that referenced this issue Oct 2, 2016
This adds support for using amazon-ebs/amazon-instance builder without
a keypair. If a ssh_private_key_file is supplied without a
ssh_keypair_name no temporary ssh keypair is created. If ssh_password is
used no temporary ssh keypair is created and the password is used when
trying to connect.

Closes hashicorp#2301
Closes hashicorp#3156
@rickard-von-essen
Copy link
Collaborator

Please test if PR #3953 solves your issue.

@rickard-von-essen rickard-von-essen self-assigned this Oct 2, 2016
@ghost ghost locked and limited conversation to collaborators Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants