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 --url ssh:// fails wierdly #17452

Closed
avikivity opened this issue Feb 9, 2023 · 6 comments · Fixed by #23847
Closed

podman --url ssh:// fails wierdly #17452

avikivity opened this issue Feb 9, 2023 · 6 comments · Fixed by #23847
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@avikivity
Copy link

Issue Description

podman --url ssh://... fails to work in strange ways.

Steps to reproduce the issue

I have the podman socket listening on localhost. To explore how podman/ssh work, I try connecting to it via ssh.

To start with, unix: does not have good defaults. I can get it to work with

podman  --url=unix://run/user/1000/podman/podman.sock ps

But things like

podman --url=unix://

or

podman  --url=unix://avi@ ps

Fail with

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: Get "http://d/v4.3.1/libpod/_ping": dial unix //: connect: permission denied

This is a minor usability problem as I have to remember that podman socket path template and supply my uid. I think it could be guessed for unix://user@.

Next, for ssh:

$ podman  --url=ssh://localhost ps
Error: strconv.Atoi: parsing "": invalid syntax
$ podman  --url=ssh://avi@localhost/ ps
Error: strconv.Atoi: parsing "": invalid syntax

I guess it wants the port, but really it should be defaulted.

$ podman  --url=ssh://avi@localhost:22/ 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: Get "http://d/v4.3.1/libpod/_ping": ssh: rejected: connect failed (open failed)

Now I need to supply the path. Given it's a remote path, I need to know my remote uid.

This works:

podman  --url=ssh://avi@localhost:22/run/user/1000/podman/podman.sock ps

But one needs to supply the default ssh port, the default podman socket path, and their remote uid, which they really shouldn't need to.

Describe the results you received

Intermingled with the reproducer.

Describe the results you expected

--url ssh://avi@localhost works and no internal error messages.

podman info output

$ rpm -q podman
podman-4.3.1-1.fc37.x86_64

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

No

Additional environment details

Fully updated Fedora 37.

Additional information

Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting

@avikivity avikivity added the kind/bug Categorizes issue or PR as related to a bug. label Feb 9, 2023
@Luap99
Copy link
Member

Luap99 commented Feb 10, 2023

I think the default port thing for ssh was already fixed in 4.4. #16526

While we could assume some more defaults I think it makes more sense to just use podman system connection ... to manage connection urls. So you can just do podman -c <CONNAME> ...

@avikivity
Copy link
Author

But then I still have to supply those full URLs, no?

I think it's nicer if I don't have to know things like the UID on a remote machine.

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Mar 15, 2023

Care to open a PR to handle this?

@avikivity
Copy link
Author

Care to open a PR to handle this?

If you mean me, then no. I can't justify the effort to learn the podman codebase and (a small subset of) golang just to fix this wart.

@dustymabe
Copy link
Contributor

I agree that not having to know the numerical remote user ID would be nice.

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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants