Open jtognazzi opened 2 months ago
The issue mentioning the identity should not be set is https://github.com/containers/podman/issues/7806 and https://github.com/containers/podman/issues/15121 is kind of related but trying to connect to a WSL instance and not a remote, but I think this is relevant.
Of course, a workaround would be to use a key with an empty passphrase.
Running headfirst into this issue myself. I have a remote Fedora machine running podman as the host, and a Windows 11 desktop I would like to use as the remote client.
I have a Ed25519 key generated on the client machine, then added to the authorized_keys on the host. The key on the Windows machine is encrypted at rest with a passphrase.
I generated the connection using podman --remote system connection add remotehost --identity C:\Users\username\.ssh\id_ed25519 ssh://username@192.168.5.254/run/user/1000/podman/podman.sock
Running podman system connection list
I get:
Name URI Identity Default ReadWrite
remotehost ssh://username@192.168.5.254:22/run/user/1000/podman/podman.sock C:\Users\username\.ssh\id_ed25519 true true
Then after running podman info
I get an input request for the Key Passphrase, which I enter and the remote host information is displayed correctly in full.
If I run podman info
again seconds later, within the same PowerShell window, it asks me for the passphrase again.
Now, if I create the connection without an identity I get a different error, as the host is configured to ONLY accept key authentication.
PS C:\Users\username> podman --remote system connection add remotehost ssh://usernamep@192.168.5.254/run/user/1000/podman/podman.sock
PS C:\Users\username> podman system connection list
Name URI Identity Default ReadWrite
remotehost ssh://usernamep@192.168.5.254:22/run/user/1000/podman/podman.sock true true
PS C:\Users\username> podman -c remotehost ps
Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM
Error: unable to connect to Podman socket: failed to connect: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain
I wonder if perhaps the work on the ssh interface from containers/podman/pull/15094 could hold an answer, and forcing --ssh native
could help as my cursory look suggests it might. In that PR, @cdoern said they will
go back and abstract the idea of podman --remote from golang's dialed clients, as it should not be so intrinsically connected. Overall, this is a v1 of a long process of offering native ssh
But they appear to be on a different project now, and haven't made a PR since Dec 2022 so I'm unsure if the native ssh project stalled when they moved within Red Hat.
A friendly reminder that this issue had no activity for 30 days.
Issue Description
I was following the Podman remote-client tutorial and couldn't make it use the ssh agent.
In the tutorial it is using an identity when creating the new remote connection, but this leads to be asked for the key passphrase. I read somewhere that I should not set an identity so the connection would use my ssh agent, but it does not seem to be working on windows.
Steps to reproduce the issue
Prerequsite: You should have a linux box with podman installed and running as rootless
Steps to reproduce the issue
Describe the results you received
podman is asking for the user password
Describe the results you expected
podman can connect without interaction
podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
Additional environment details
Additional information
If I set an identity when creating the connection, then it asks for the key passphrase.
I also tried to explicit set $env:SSH_AUTH_SOCK="\.\pipe\openssh-ssh-agent", but then I have this error
But this was just a guess and I'm not sure it is relevant