Skip to content
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

podman remote not using ssh-agent on Windows #24144

Open
jtognazzi opened this issue Oct 3, 2024 · 2 comments
Open

podman remote not using ssh-agent on Windows #24144

jtognazzi opened this issue Oct 3, 2024 · 2 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. windows issue/bug on Windows

Comments

@jtognazzi
Copy link

jtognazzi commented Oct 3, 2024

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

  1. Add a new connection
    podman --remote system connection add remote ssh://myuser@mylinuxbox/run/user/1000/podman/podman.sock
  2. List the existing connections
> podman --remote system connection list 
Name                         URI                                                                 Identity                                                          Default     ReadWrite
podman-machine-default       ssh://[email protected]:62876/run/user/1000/podman/podman.sock         C:\Users\MyUser\.local\share\containers\podman\machine\machine  true        true
podman-machine-default-root  ssh://[email protected]:62876/run/podman/podman.sock                   C:\Users\MyUser\.local\share\containers\podman\machine\machine  false       true
remote                       ssh://myuser@mylinuxbox:22/run/user/1000/podman/podman.sock                                                                                  false       true
  1. Check the remote connection
> podman --remote -c tognjul1 info --log-level=debug                                                                                                            
time="2024-10-03T14:14:59+02:00" level=info msg="C:\\Program Files\\RedHat\\Podman\\podman.exe filtering at log level debug"
time="2024-10-03T14:14:59+02:00" level=debug msg="Called info.PersistentPreRunE(C:\\Program Files\\RedHat\\Podman\\podman.exe -c tognjul1 info --log-level=debug)"
myuser's login password:
time="2024-10-03T14:15:03+02:00" level=debug msg="DoRequest Method: GET URI: http://d/v5.2.3/libpod/_ping"
time="2024-10-03T14:15:03+02:00" level=debug msg="DoRequest Method: GET URI: http://d/v5.2.3/libpod/info"
host:
  arch: amd64
  buildahVersion: 1.37.3
  cgroupControllers:
  - cpuset
  - cpu
  - io
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
...

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 version                                                                                                                                      
Client:       Podman Engine
Version:      5.2.3
API Version:  5.2.3
Go Version:   go1.23.1
Git Commit:   c5366a308e89edd9636b66faf79bd5cb18ed0905
Built:        Tue Sep 24 17:22:39 2024
OS/Arch:      windows/amd64

Server:       Podman Engine
Version:      5.1.1
API Version:  5.1.1
Go Version:   go1.22.3
Built:        Tue Jun  4 02:00:00 2024
OS/Arch:      linux/amd64

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

> podman -c remote info --log-level=debug                                                                                                            
time="2024-10-03T14:21:30+02:00" level=info msg="C:\\Program Files\\RedHat\\Podman\\podman.exe filtering at log level debug"
time="2024-10-03T14:21:30+02:00" level=debug msg="Called info.PersistentPreRunE(C:\\Program Files\\RedHat\\Podman\\podman.exe -c remote info --log-level=debug)"
time="2024-10-03T14:21:30+02:00" level=debug msg="Found SSH_AUTH_SOCK \"\\\\\\\\.\\\\pipe\\\\openssh-ssh-agent\", ssh-agent signer enabled"
time="2024-10-03T14:21:30+02:00" level=debug msg="Using Podman machine with `wsl` virtualization provider"
OS: windows/amd64
provider: wsl
version: 5.2.3

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: dial unix \\.\pipe\openssh-ssh-agent: connect: No connection could be made because the target machine actively refused it.
time="2024-10-03T14:21:30+02:00" level=debug msg="Shutting down engines"

But this was just a guess and I'm not sure it is relevant

@jtognazzi jtognazzi added the kind/bug Categorizes issue or PR as related to a bug. label Oct 3, 2024
@github-actions github-actions bot added the windows issue/bug on Windows label Oct 3, 2024
@jtognazzi
Copy link
Author

jtognazzi commented Oct 3, 2024

The issue mentioning the identity should not be set is #7806
and #15121 is kind of related but trying to connect to a WSL instance and not a remote, but I think this is relevant.

@jtognazzi
Copy link
Author

Of course, a workaround would be to use a key with an empty passphrase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. windows issue/bug on Windows
Projects
None yet
Development

No branches or pull requests

1 participant