Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Connect via SSH with key #259

Open
alexborisov opened this issue Apr 5, 2020 · 5 comments
Open

Connect via SSH with key #259

alexborisov opened this issue Apr 5, 2020 · 5 comments

Comments

@alexborisov
Copy link

How can I use key authentication when connecting via ssh?

@AdrianLsk
Copy link

You have to define it in your ssh config, there is no other way at the moment.

I am dealing with the same problem, where I cannot automate docker deployment on a remote machine using terraform cloud because of this missing feature.

@alexborisov
Copy link
Author

alexborisov commented Apr 7, 2020 via email

@znck
Copy link

znck commented May 21, 2020

@alexborisov can you point to the resource or give some code sample?

@ruby232
Copy link

ruby232 commented Aug 21, 2020

It worked for me to configure the ssh and upload the private key beforehand.
~/.ssh/config

Host server
  HostName 10.10.10.10
  User root

upload primary key to server

ssh-copy-id root@10.10.10.10

main.tf

provider "docker" {
  host = "ssh://server"
}

@harryjubb
Copy link

Relates to / duplicated by #268

@znck PR'd some work to the Docker CLI to help enable this, docker/cli#2541

Presumably if that is merged, it would be possible to add to the Terraform provider?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants