Over the week I’ve been dealing with the Kinsing virus via Docker on my VPS. I’ve been learning about it and I’ve come to find I’ve been thinking about Docker all wrong with the way that I was using it.

I enjoy using Portainer, so that’s a must for me. I know Docker allows you to secure Docker sockets via context; docker context create vps --docker "host=ssh://user@vps".

I would like to use this method, via Portainer (locally) to connect to docker (remote) via SSH. Anyone know of a way to do this? I’ve been looking around and haven’t found much.

  • beek@beehaw.org
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    11 days ago

    Not a Docker expert by any stretch, but I believe Portainer can only connect to the socket locally. If you were to bind that socket over a ssh tunnel, you’d be limiting your Portainer to managing a single machine. You’d also be dealing with broken pipe errors every time the connection went idle.

    Given those limitations, it’s much easier (and, I’d argue, more secure) to just spin up a Portainer container on that machine.

    If you absolutely must use SSH, see this thread for the only working solution AFAIK:

    https://github.com/portainer/portainer/issues/431