-
-
Notifications
You must be signed in to change notification settings - Fork 622
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
[Gitea] ssh server not updating authorized keys #2380
Comments
I found the solution in go-gitea/gitea#17175 I had the same problem and was able to fix it by setting ~/.ssh/config similarly to:
This could also be fixed by adding
to the [server] section of gitea's app.ini |
Neither of the two methods worked for me. Not sure why the first didn't work, but I think the second one didn't work because no ed25519 key is generated automatically, and ssh-keygen isn't installed in the docker container for some reason? I also cant install it because apk needs more permissions and sudo, doas, and su don't work. |
Here's the verbose output when trying to connect via ssh:
This is without the SSH_SERVER_HOST_KEYS setting set on the server |
Maybe a typo?
|
Oh wow, now I feel stupid. Before setting the ssh-rsa thing I always tested with both public and private key because I wasn't sure which one I should use, but now after setting it I completely forgot. This fixed my issue, thank you! |
This issue is locked to prevent necro-posting on closed issues. Please create a new issue or contact staff on discord of the problem persists |
Details
Container name and tag:
gitea 1.16.5_6.0.15
What steps did you take and what happened:
I set up gitea with mostly standard settings, created an account and added an ssh public key (~/.ssh/nasbox-git.pub), and ran the command
ssh -i ~/.ssh/nasbox-git -T git@gitea.nasbox.net -p 2222
The result is always
git@gitea.nasbox.net: Permission denied (publickey).
Cloning repos via ssh doesn't work either, but works via https.
Even after running the "Resynchronize pre-receive, update and post-receive hooks of all repositories." and "Update the '.ssh/authorized_keys' file with Gitea SSH keys." tasks.
Here's the application configuration:
The nasbox.net domain is only local and handled via a pihole Local DNS Record, and works for the webinterface, but I've also tried sshing via the ip.
Here's the gitea pod log when running the previously mentioned tasks:
2022-04-01 19:33:39.015254+00:00�[36m2022/04/01 21:33:39 �[0mStarted �[34mGET�[0m �[1m/assets/serviceworker.js�[0m for �[1m172.16.0.209:40428�[0m 2022-04-01 19:33:39.015301+00:00�[36m2022/04/01 21:33:39 �[0mCompleted �[34mGET�[0m �[1m/assets/serviceworker.js�[0m �[36m304�[0m �[36mNot Modified�[0m in �[32m133.542µs�[0m
2022-04-01 19:34:21.463465+00:00�[36m2022/04/01 21:34:21 �[0mStarted �[34mGET�[0m �[1m/assets/serviceworker.js�[0m for �[1m172.16.0.209:40658�[0m 2022-04-01 19:34:21.463633+00:00�[36m2022/04/01 21:34:21 �[0mCompleted �[34mGET�[0m �[1m/assets/serviceworker.js�[0m �[36m304�[0m �[36mNot Modified�[0m in �[32m177.226µs�[0m
And here's the log from a failed ssh connection test
2022-04-01 19:38:18.119399+00:00�[36m2022/04/01 21:38:18 �[0m�[32mmodules/ssh/ssh.go:260:�[32msshConnectionFailed()�[0m �[1;33m[W]�[0m Failed connection from �[1m192.168.178.72:46914�[0m with error: �[1m[ssh: no auth passed yet]�[0m 2022-04-01 19:38:18.119449+00:00�[36m2022/04/01 21:38:18 �[0m�[32mmodules/ssh/ssh.go:262:�[32msshConnectionFailed()�[0m �[1;33m[W]�[0m Failed authentication attempt from �[1m192.168.178.72:46914�[0m
Looking through the filesystem of the gitea pod, I could find a few ssh or .ssh folders (like /data/ssh and /data/git/.ssh) but none of them contained an authorized_keys file, and manually creating it didn't help.
The text was updated successfully, but these errors were encountered: