It is probably not a Gitea-specific problem, but maybe you can help me anyway. I got a server that runs no whatever.com with ngingx. And I have a default binary gitea installation running on whatever.com:3000 and nginx proxy from https://git.whatever.com to 3000 port.
The problem is that any request to git asks for a git password even when ssh key is installed and verified:
Actually, I found the problem. Git user was not allowed to be accessed via sshd in ssh configuration. I think it makes sense to add a small addition to check it in the installation instructions.
Hi there, You've successfully authenticated, but Gitea does not provide shell access.
If this is unexpected, please log in with password and setup Gitea under another user.
Documentations below:
SSH issues
If you cannot reach repositories over ssh, but https works fine, consider looking into the following.
First, make sure you can access Gitea via SSH.
ssh git@myremote.example
If the connection is successful, you should receive an error message like the following:
Hi there, You've successfully authenticated, but Gitea does not provide shell access.
If this is unexpected, please log in with password and setup Gitea under another user.
If you do not get the above message but still connect, it means your SSH key is not being managed by Gitea. This means hooks won't run, among other potential problems.
But it shuold’t ask a password.
I have the same problem. And my steps are:
(my gitea user fo service is: “gitea”, not a “git”)
create user in Gitea, for example: alexey111
Create RSA keys on my client with ssh-keygen
Add RSA_Pub part of keys to Gitea interface to alexey111
Try to SSH like this
PS C:\Users\Admin\Desktop\git_test\my-project2> ssh -T gitea@giteahome.local
Hi there, alexey111! You've successfully authenticated with the key named id_ed25519 test, but Gitea does not provide shell access.
If this is unexpected, please log in with password and setup Gitea under another user.
You should check
RSA keys, they also should be in home directory of your git user like: /home/git/.ssh
You should create git user with shell access like:
adduser \
--shell /bin/bash \
my problems was that i create user without flag --shell /bin/bash, so have no shell at all. And i map user home directory in different folder not in /home/user/, so system can’t find out my rsa keys.
I’ve done exactly that, but it is not helpful. It says that login with the key failed with error 51. While searching for this error 51, I checked similar issues and had to go to ssh config, there I found the problem. The ssh config is split into several files so it is not that easy to find. Luckily, webmin shows all configuration in the same window.
If a password prompt, that means no public key found on ssh server to match your local private key. The authorized_keys is managed by Gitea and it can be regenerated by click the sync button on admin panel.
The problem is that the key exists, but the user git did not have access rights for ssh. When I added git to ssh allowed users, everything started to work right away. The ssh message log is completely misleading though.