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

"Update the '.ssh/authorized_keys' file" claims to be successful, to no effect #5795

Closed
2 tasks done
mytskine opened this issue Jan 21, 2019 · 1 comment
Closed
2 tasks done

Comments

@mytskine
Copy link

  • Gitea version (or commit ref): 1.5.0
  • Git version: 2.11
  • Operating system: Debian stable
  • Database (use [x]):
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Not relevant

Description

The bug is that Gitea declares a file was modified, but the file does not exist or (if created externally) stays unchanged.

As an admin user, clicking on "Update the '.ssh/authorized_keys' file with Gitea SSH keys" produces the message "The public SSH keys controlled by Gitea have been updated". I've checked that ~git/.ssh/authorized_keys was unchanged, so which file was modified? The action does not appear in the log files of Gitea, even at Trace level. The consequence is that SSH access is broken on this instance.

BTW namei -l ~git/.ssh/authorized_keys shows that the file is writable by the git user, which is the user running gitea and declared in the RUN_USER config variable. I tried to use the documentation to debug more, but the SSH process is unmentioned, apart from vague references in the "Troubleshouting" page (the various terms "user", "repository", "directory"… are unclear, because there are several of them).

@mytskine
Copy link
Author

The problem was that the homedir of the "git" user was overwritten when running gitea web. I suggest to update the file /contrib/systemd/gitea.service and replace the line

Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea

with

Environment=GITEA_WORK_DIR=/var/lib/gitea

The unix user is already declared in the ".service" file, so these environment variables will be automatically filled. Overwriting HOME can only lead to hard-to-track errors.

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

2 participants