Replies: 1 comment 2 replies
-
@CobyPear I don't see the environment variables related to the SSH server in your setup. Did you set these?
BTW: the default port number is 3022 - if you want to use 2222, you are responsible for configuring your instance correctly. I just set up a Forgejo instance with rootless podman (slirp4netns network) and I didn't do anything else than use the above settings. Of course, you also need to paste your user's SSH pubkey in the Forgejo user panel. Lastly, if you want to test the connection, make sure to enable sufficient level of verbosity because otherwise yo will not see the message welcoming you and then closing the connection, as Forgejo SSH does not provide shell access. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Problem:
I am trying to self host Forgejo (a fork of Gitea: same docs for installation) using podman and the rootless image of Forgejo. I've gotten almost everything working except for the ssh passthrough. I am able to ssh from the host machine, but when I try sshing from a different client, I am met with an error from the passthrough command that the container trying to run the exec command is not found (see the SSH Container Passthrough below to understand what I'm talking about here, sorry I can't explain it better!). With the default names, the error looks like this in the verbose output of the client's
ssh
command:Error: no container with name or ID "gitea" found: no such container
And the logs insshd
on the host show that the public key was accepted and the AuthorizedKeyCommand was run but then something fails:I have gotten all of this working in the past including the ssh passthrough, but I distinctly remember starting the container as root, which seems to defeat the whole purpose!
If this is not possible with rootless podman, I would love to know so I can maybe add a note to the Gitea docs to save others from this frustration.
Machine info
OS: Asahi Linux - Arch flavor (arm)
Various other potentially relevant config:
Caddy reverse proxy:
Pi-hole DNS routing
git.server.home
on my network tolocalhost
of the host machineSteps to reproduce
Assuming you are the user
1000:1000
let's call it "admin", and you create a user1001:1001
called "forgejo"mkdir ~/forgejo
touch docker-compose.yml .env
docker-compose.yml
podman unshare chown -R 1001 /path/to/volumes
will be necessary. To find the volume path I usedpodman volume inspect $VOLUME_NAME
podman unshare mkdir -p /path/to/data/volume/_data/git
to get around Gitea rootless setup error: mkdir: can't create directory '/var/lib/gitea/git': Permission denied go-gitea/gitea#22322podman-compose up -d
git.server.home
and complete the installation. I added an admin user and kept pretty much everything else as default.ssh -Tv [email protected]
to see the error.What else have you tried?
userns: keepid
podman unshare
, but I don't think this is necessary or helped.Beta Was this translation helpful? Give feedback.
All reactions