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

Docker sshd_config unconfigured for gitea #7969

Closed
2 of 7 tasks
GijsVermarien opened this issue Aug 25, 2019 · 3 comments
Closed
2 of 7 tasks

Docker sshd_config unconfigured for gitea #7969

GijsVermarien opened this issue Aug 25, 2019 · 3 comments

Comments

@GijsVermarien
Copy link

  • Gitea version (or commit ref): Gitea version 1.10.0+dev-209-g8c24bb9e4 built with GNU Make 4.2.1, go1.12.9 : bindata, sqlite, sqlite_unlock_notify
  • Git version: git version 2.22.0
  • Operating system: Docker version 18.09.7, build 2d0083d on 18.04.3 LTS (Bionic Beaver)
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

When I recreated my docker file, the ssh options were not working anymore, I now get the following error when trying to connect:
[email protected]: Permission denied (publickey).

The gitea logs show that:
User user from XX.XXX.XXX.XXX not allowed because not listed in AllowUsers
Connection closed by invalid user user XX.XXX.XXX.XXX port 46XXX [preauth]

The AllowUsers file in /etc/ssh/sshd_config indeed only contains:
AllowUsers git

Is there any way to solve this problem so I can again use gitea, I cannot pull/push anything because of this issue.

I saw that issue #5623 relates to this, and the code reflects that gitea should be added as a user to AllowUsers, but somehow it is not.

@jpellegrini
Copy link
Contributor

jpellegrini commented Sep 4, 2019

That file (sshd_config) is generated by s6 from a template, which is in docker/root/etc/templates/sshd_config. The only variable in the template is SSH_PORT. The user in AllowedUsers should also be a variable.

Try modifying this line

AllowUsers git

into this:

AllowUsers ${USER}

in the template. Then rebuild the docker image. When you log into the container, you'll see the correct line in /etc/ssh/sshd_config.

@lunny
Copy link
Member

lunny commented Sep 6, 2019

This should be resolved by #8094

@lunny lunny closed this as completed Sep 6, 2019
@GijsVermarien
Copy link
Author

It is indeed resolved, I recreated the docker container with the latest image and it is working just fine now!

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants