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

remote-exec and file privisioners failling to authenticate #2563

Closed
jmreicha opened this issue Jun 29, 2015 · 5 comments
Closed

remote-exec and file privisioners failling to authenticate #2563

jmreicha opened this issue Jun 29, 2015 · 5 comments

Comments

@jmreicha
Copy link

I am attempting to spin up a server using the remote-exec/file provisioners and am running in to issues. I had previously (0.4.x) used remote-exec successfully but it no longer seems to be working as I had expected. Did something change recently or maybe I am overlooking something simple?

Here is the bit in my .tf file.

provisioner "remote-exec" {
    inline = [ "echo 'hello world' >> /tmp/test.txt" ]
    connection {
        user = "custom_user"
        key_file = "${var.key_path}"
    }
  }

The key_path variable is pointing at the private key.

variable "key_path" {
    default = "~/.ssh/my_private_key"
}

Here is the error.

aws_instance.sentry (remote-exec): Connecting to remote host via SSH...
aws_instance.sentry (remote-exec):   Host: x.x.x.x
aws_instance.sentry (remote-exec):   User: custom_user
aws_instance.sentry (remote-exec):   Password: false
aws_instance.sentry (remote-exec):   Private key: true
aws_instance.sentry (remote-exec):   SSH Agent: true
aws_instance.sentry: Error: 1 error(s) occurred:

* ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
Error applying plan:

1 error(s) occurred:

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

I can manually SSH to the server with the key file I am attempting to use.

@ocxo
Copy link

ocxo commented Jul 2, 2015

Seeing this also since upgrading to 0.6.0.

@bltavares
Copy link
Contributor

I was able to work around setting "agent = false" on the connection settings, on 0.6.0

On July 2, 2015 7:41:50 PM GMT-03:00, Adam Ochonicki notifications@github.com wrote:

Seeing this also since upgrading to 0.6.0.


Reply to this email directly or view it on GitHub:
#2563 (comment)

Sent from my Android device with K-9 Mail. Please excuse my brevity.

@phinze
Copy link
Contributor

phinze commented Jul 2, 2015

Ah sorry I let this slip and didn't see it until #2614 - ended up fixing it in #2615 - agent = false should work around the issue in 0.6.0 and will be unnecessary once 0.6.1 is released (estimating that we'll cut it within a week).

@phinze phinze closed this as completed Jul 2, 2015
@manideep309
Copy link

still getting the issue in 0.10.8

vsphere_virtual_machine.web: Still creating... (5m30s elapsed)
vsphere_virtual_machine.web (remote-exec): Connecting to remote host via SSH...
vsphere_virtual_machine.web (remote-exec): Host:
vsphere_virtual_machine.web (remote-exec): User: root
vsphere_virtual_machine.web (remote-exec): Password: true
vsphere_virtual_machine.web (remote-exec): Private key: false
vsphere_virtual_machine.web (remote-exec): SSH Agent: false

Error: Error applying plan:
 
1 error(s) occurred:

  • vsphere_virtual_machine.web: 1 error(s) occurred:
     * timeout

@ghost
Copy link

ghost commented Apr 5, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants