-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to authenticate with podman-remote over ssh to drive remote podman.sock #8323
Comments
Does |
Can you provide the output of |
@Luap99 thanks for looking into this.
That is the correct username and IP for the remote machine, and the SSH key is in the client ssh agent. SSHing normally works fine. |
@Luap99 I don't know if it helps, but I dug into it a bit and the error message comes from a dependency, line 77 of For convenience again this is the error message:
I wondered if the SSH connection doesn't even try to authenticate with the key. If the key isn't in the ssh-agent then it will ask for the passphrase but then fails the same way. I thought too maybe a possible bug in |
That error is coming from pkg/bindings/connection.go:252. The go ssh client is failing to connect to the remote sshd. It currently uses either public key (directly or via ssh-agent) or password authentication methods. Given your connection string it should be using public key. If you add |
And ssh has no problem connecting to the host. Yes, I am using ssh-agent as they keys are encrypted at rest.
The correct key is the first one but I really doubt that the macos podman cli is really trying to use the agent key. |
@FreedomBen I added #8499 (comment) Could that be related here as well? |
@jwhonce Interesting, it could be related. When I tried |
hi, did you run his command.I have same error on my macOS big sure $ podman ps
Error: failed to create sshClient: dial unix /private/tmp/com.apple.launchd.zFwQB0vrnx/Listeners: connect: no such file or directory
FAIL: 125 I think it is ssh-client or system config question, after I run that command , it was solved. eval "$(ssh-agent -s)" |
A friendly reminder that this issue had no activity for 30 days. |
A friendly reminder that this issue had no activity for 30 days. |
A friendly reminder that this issue had no activity for 30 days. |
@ssbarnea @Talbot3 @FreedomBen Is this still an issue? A lot of work has been happening in podman-remote for Mac. |
Ah! Fedora by default rejects rsa keys, if you use an ed25519 key, this works properly. Closing now, If this is still an issue, please re-open. |
I would like to confirm the above, saw the same issue (Fedora 34 host, Big Sur 11.3.1 Mac, podman 3.1.2 at both ends). By generating an ed25519 key this worked perfectly after a frustrating 30 minutes with my old rsa key. |
Thanks @tonykay, I've run into the same issue on my macOS Big Sur. I think this article https://www.redhat.com/sysadmin/podman-clients-macos-windows should be updated accordingly |
@rhatdan @ashley-cui I think forcing people to regenerate keys here is a pretty poor user experience. I'm also concerned that the actual issue is that podman/go are using SHA1 for the key exchange protocol for RSA keys and that's actually what is causing issues in some cases. When I tried using an RSA key on a CentOS Stream 9 machine to copy an image to a different CentOS 9 Stream machine, it keeps failing even though normal ssh between the machines with the same key works fine. If that's actually the case, then having podman use a different encryption for the key exchange should allow RSA keys to work. |
@baude @jwhonce @mtrmac @vrothberg PTAL |
Cc: @lsm5 |
I am still hitting this problem on an M1 Mac even after regenerating the ssh key.
MacOS doesn't have the |
TBH, I find very annoying that I need to run |
@jwboyer do you have a reproducer for this? I tried |
Yep, I tried this again today using a CentOS Stream 9 VM trying to CentOS Stream 9 machine info
SSH connection with the key working:
Podman connection add
podman image scp failing with handshake issue
RHEL 9 VM info
As you can see, an SSH works fine between the machines with the same key, but |
I have also hit this issue, with RSA keys being rejected. I agree with @jwboyer that it would be far better for users to be able to use the same keys that are usable by the standard ssh client. To be clear, I am able to ssh using the RSA key, but podman rejects it, so this is not simply the remote host rejecting the key. I have seen this sshing to Ubuntu22.04 and CentOS9. In general it would be preferable for podman to default to using the same ssh keys that the ssh client uses rather than having to specify Could this be reopened as I think there's still an issue in podman here? |
If the hypothesis is using SSH with RSA keys and SHA1 (where it should be using SHA2), please follow #14001 , it contains more recent investigation, and in particular a supposed fix. |
Am I right to assume there won't be a fix/workaround in v3.x then? :( |
That is a safe assumption. |
i run run command before:
run command after:
|
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Trying to run Podman on a remote machine and use the podman-remote client to drive it.
Following instructions here: https://github.com/containers/podman/blob/master/docs/tutorials/mac_win_client.md
Podman on the remote machine seems to be working fine, but it cannot be driven by the local podman because the local Podman fails to authenticate properly over SSH.
Steps to reproduce the issue:
Describe the results you received:
Authentication error:
Error: Failed to create sshClient: Connection to bastion host (ssh://[email protected]:22/run/user/1000/podman/podman.sock) failed.: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
Describe the results you expected:
I expected
podman-remote ps
to behave normally, outputting something like this:Additional information you deem important (e.g. issue happens only occasionally):
I also tried adding the connection with an explicit identity file instead of relying on the SSH agent:
podman system connection add test2 --identity /home/ben/.ssh/id_rsa ssh://192.168.122.1/run/user/1000/podman/podman.sock
When running
podman-remote ps
with that connection, I am prompted for the passphrase for the SSH key (as I would expect) but I get the same error message indicating that authentication failed, I think because podman didn't do the SSH handshake properly or something:Error: Failed to create sshClient: Connection to bastion host (ssh://[email protected]:22/run/user/1000/podman/podman.sock) failed.: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
I also checked to make sure that
/run/user/1000/podman/podman.sock
existed on the remote machine, and it did. Remote user id is 1000 as expected.Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
Remote podman is the same latest version (2.1.1), running on an F33 Server that is in a KVM VM on a Dell R620 host. Local podman version 2.1.1 is on an F32 Workstation with Gnome 3, and a nice photo of my family as the wallpaper background and screensaver.
The text was updated successfully, but these errors were encountered: