Terraform v0.11.7
### Terraform Configuration Files
connection {
user = "centos"
private_key = "${file("${var.key_path}/${var.key_name}.pem")}"
}
Code below is not working either.
connection {
user = "centos"
host = "${aws_instance.cdh_server.public_ip}"
agent = false
private_key = "${file("${var.key_path}/${var.key_name}.pem")}"
}
```
DEBUG] plugin.terraform: file-provisioner (internal)
[WARN] ssh: handshake failed: ssh: unable to authenticate, attempted methods
[publickey none], no supported methods remain
[DEBUG] plugin.terraform: file-provisioner (internal)
[WARN] retryable error: ssh: handshake failed: ssh: unable to authenticate,
attempted methods [publickey none], no supported methods remain
1 error(s) occurred:
Changed the permission of private key to 600 solved the problem.
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.
Most helpful comment
Changed the permission of private key to 600 solved the problem.