# Failing to specify an ssh endpoint for docker provider

**URL:** <https://community.traefik.io/t/failing-to-specify-an-ssh-endpoint-for-docker-provider/9738>\
**Category:** Traefik v2\
**Tags:** docker\
**Created:** [February 17, 2021, 3:49pm UTC](https://community.traefik.io/t/failing-to-specify-an-ssh-endpoint-for-docker-provider/9738 "2021-02-17T15:49:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![coolnodje](https://avatars.discourse-cdn.com/v4/letter/c/a183cd/32.png) [@coolnodje](https://community.traefik.io/u/coolnodje)\
**Post date:** [February 17, 2021, 3:49pm UTC](https://community.traefik.io/t/failing-to-specify-an-ssh-endpoint-for-docker-provider/9738/1 "2021-02-17T15:49:35Z")

</div>

I feel dumb as this should be straightforward but I can't find any match for this error:  
I'm simply trying to replace the default docker provider endpoint in a docker-compose.yml `command:` section from

`- --providers.docker.endpoint=unix:///var/run/docker.sock`

to

`- --providers.docker.endpoint="ssh://user@192.168.0.135"`

and I get this error:

`msg="Failed to create a client for docker, error: parse \"\\\"ssh://user@192.168.0.135\\\"\": first path segment in URL cannot contain colon" providerName=docker`

And if I don't quote the ssh string as in

`- --providers.docker.endpoint=ssh://user@192.168.0.135`

I get this error:

`exec: \"ssh\": executable file not found in $PATH" providerName=docker`

What am I doing wrong here?

---

<div class="post-metadata">

**Author:** ![cakiwi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/cakiwi/32/3205_2.png) [@cakiwi](https://community.traefik.io/u/cakiwi)\
**Post date:** [February 18, 2021, 3:04am UTC](https://community.traefik.io/t/failing-to-specify-an-ssh-endpoint-for-docker-provider/9738/2 "2021-02-18T03:04:26Z")

</div>

Hi @coolnodje

I didn't know you could do that with traefik.

Based on the second error you are missing ssh.  
If you're using the traefik container ssh is not installed, you could try building your own and add openssh-client.

---

<div class="post-metadata">

**Author:** ![coolnodje](https://avatars.discourse-cdn.com/v4/letter/c/a183cd/32.png) [@coolnodje](https://community.traefik.io/u/coolnodje)\
**Post date:** [February 18, 2021, 11:23am UTC](https://community.traefik.io/t/failing-to-specify-an-ssh-endpoint-for-docker-provider/9738/3 "2021-02-18T11:23:55Z")

</div>

hum, that's right, the ssh binary should be available from the Traefik docker container.  
This is the 1st method advised by traefik documentation to secure the traefik install.

I would have expected the ssh binary to be readily available then, but since the traefik image is based on Alpine, it takes an extra step to make ssh available.

Based on this I got it working, by manually connecting to the Traefik container, then `apk add openssh` then creating a private/pub key, adding the private to the container and the public to the docker host .ssh/authorized\_keys.

It's really nice to see this working but it'd be way too convoluted to automate this for me.

So I guess until Traefik offers a solution to implement this easily I'll have to keep the default Unix socket solution, and secure the Traefik dashboard/api with an IP whitelisting middleware

---

<div class="post-metadata">

**Author:** ![cakiwi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/cakiwi/32/3205_2.png) [@cakiwi](https://community.traefik.io/u/cakiwi)\
**Post date:** [February 18, 2021, 1:11pm UTC](https://community.traefik.io/t/failing-to-specify-an-ssh-endpoint-for-docker-provider/9738/4 "2021-02-18T13:11:56Z")

</div>

> [@coolnodje](#):
>
> It's really nice to see this working but it'd be way to convoluted to automate this for me.

In your position I would make an image downstream. The overhead being to do this when you want the next version.

```auto
> cat Dockerfile
FROM traefik:v2.4
RUN apk -u add openssh-client

> docker build -t mytraefik .

```

> [@coolnodje](#):
>
> This is the 1st method advised by traefik documentation to secure the traefik install.

To be fair to the docs it says:

> Expose the Docker socket over TCP or SSH, instead of the default Unix socket file.

But I agree with your sentiment, traefik documentation supports a docker socket via ssh buts lacks the dependency to connect.

Looks like some of the functionality was merged but comments on the PR show the same issue you experienced.

> <https://github.com/traefik/traefik/issues/4598>
>
> \### Do you want to request a \*feature\* or report a \*bug\*?
> Feature
> 
> \### Sugges…tion
> 
> Docker supports connecting to a daemon via ssh from 18.09: https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-socket-option 
> 
> Implementing this would solve the security issues of mounting the Unix socket, as well as being able to run on worker.
> 
> \### What did you expect to see?
> Support for ssh protocol
> 
> 
> \### What did you see instead?
> Only TCP or Unix
