-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Feature request description
When using podman --connection <conn> ... commands to manage remote hosts, Podman currently relies on the OpenSSH channel type [email protected] to tunnel the local API request to the remote Unix socket.
When running these commands on a Tailscale network against a remote host that has Tailscale SSH enabled, the Tailscale SSH server will reject the request with the error Error: ssh: rejected: unknown channel type (unsupported channel type) .
Steps to Reproduce:
- Set up a remote Linux host (VM or VPS).
- Install both Podman and Tailscale on the local machine and remote host. Connect both machines to the tailscale network and enable Tailscale SSH on the remote host.
- Add the remote connection
podman system connection add remote-ssh ssh://user@tailscale-ip. - Attempt to list images:
podman --connection remote-ssh images.
Result: The command fails with the error Error: ssh: rejected: unknown channel type (unsupported channel type).
This proposal does not apply to the podman image scp ... command, which already utilizes the SSH session channel type.
Suggest potential solution
Implementation of a fallback mechanism that does not rely on the [email protected] SSH channel type to improve compatibility with Tailscale and other SSH restricted environments.
- Create a new SSH client wrapper that implements the
net.Conninterface using an SSHsessionchannel. - On
session.Startthe commandpodman system dial-stdiowould be executed to proxy the session input/output to the Unix socket on the remote host. - The SSH client wrappers
ReadandWritemethods would map to the sessionsstdoutandstdinrespectively, piping the API calls to the remote Unix socket. - This fallback logic would trigger when
ssh.DialNetthrows an error in.podman/pkg/bindings/connection.go
Line 301 in ac91395
return ssh.DialNet(conn, "unix", _url)
If this is an acceptable approach, I have a working implementation I can provide as either a pull request or for more context around the proposed implementation.
Have you considered any alternatives?
There is an available workaround where the commands can be directly invoked via ssh, for example ssh user@tailscale-ip podman images.
Additional context
The Tailscale issue tailscale/tailscale#12409 is related.