/
English version (French version at the bottom)
My YunoHost server
Hardware: VPS bought online
YunoHost version: 11.0.9.14
I have access to my server : Through SSH | through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : yes
If yes, please explain: password authentication is disabled and ssh is on a custom port
Description of my issue
I have installed Gitea on my Yunohost server. I added my public key (ed25519) to Gitea. I am able to verify that in the file /home/yunohost.app/gitea/.ssh/authorized_keys.
Gitea version is 1.17.2~ynh1
The user gitea is part of the group ssh.app
I think my ssh configuration is correct, I launched the command
yunohost tools regen-conf ssh --force
I restarted the ssh service with the command
sudo yunohost service restart ssh
The file /etc/passwd contains the following line
gitea:x:996:996::/home/yunohost.app/gitea:/bin/bash
I have created a repository in Gitea which I’m trying to clone to my PC with the command
git clone ssh://gitea@domain.tld:<port>/repo/my-project.git
And the result is a ssh error
Cloning into '<my project>'...
Debian GNU/Linux 11
gitea@domain.tld: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I even updated the file ~/.ssh/config to set the IdentityFile to my ssh key (this file seems to not be used by git clone because I have to write the port when cloning…).
And at this point I’m lost ![]()
I can add that the logs look like
Sep 24 21:51:31 user sshd[12121]: Connection from <my ip> port <port> on <server ip> port <custom port> rdomain ""
Sep 24 21:51:32 user sshd[12121]: Authentication refused: bad ownership or modes for directory /home/yunohost.app/gitea/.ssh
Sep 24 21:51:32 user sshd[12121]: Failed publickey for gitea from <my ip> port <port> ssh2: ED25519 SHA256:+5B4xxxxxxxxxxxxxxxxxxxxxxxxx
Sep 24 21:51:32 user sshd[12121]: Connection closed by authenticating user gitea <my ip> port <port> [preauth]
For your information I read and tried to apply without success the propositions in the following tickets
- Can't use ssh with gitea after upgrade to yunohost 11
- [Résolu] Problème d'accès ssh Gitea
- Pas d'accès à la gitea en raison des SSH
- Gitea: incorrect .ssh/authorized_keys permissions on new instance
Version française
Mon serveur YunoHost
Matériel: VPS acheté en ligne
Version de YunoHost: 11.0.9.14
J’ai accès à mon serveur : En SSH | Par la webadmin
Êtes-vous dans un contexte particulier ou avez-vous effectué des modifications particulières sur votre instance ? : oui
Si oui, expliquer: l’authentification par mot de passe est désactivée et le port ssh a été changé
Description du problème
J’ai installé Gitea sur mon serveur Yunohost. J’ai ajouté ma clé publique (ed25519) dans Gitea. Je peux le vérifier dans le fichier /home/yunohost.app/gitea/.ssh/authorized_keys.
La version Gitea est 1.17.2~ynh1
L’utilisateur gitea fait bien partie du groupe ssh.app
Je pense que ma configuration ssh est correcte, j’ai lancé la commande suivante
yunohost tools regen-conf ssh --force
J’ai redémarré le service ssh avec la commande
sudo yunohost service restart ssh
Le fichier /etc/passwd contient la ligne suivante
gitea:x:996:996::/home/yunohost.app/gitea:/bin/bash
J’ai créé un dépôt dans Gitea que j’essaye de cloner sur mon ordinateur avec la commande
git clone ssh://gitea@domain.tld:<port>/repo/my-project.git
Et le résultat est une erreur ssh
Cloning into '<my project>'...
Debian GNU/Linux 11
gitea@domain.tld: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
J’ai même modifié le fichier ~/.ssh/config pour mettre ma clé ssh à la propriété IdentityFile (ce fichier ne semble pas être utilisé par git clone car il m’est nécessaire de renseigner le port…).
Et maintenant je suis perdu ![]()
Je peux ajouter les logs sshd :
Sep 24 21:51:31 user sshd[12121]: Connection from <my ip> port <port> on <server ip> port <custom port> rdomain ""
Sep 24 21:51:32 user sshd[12121]: Authentication refused: bad ownership or modes for directory /home/yunohost.app/gitea/.ssh
Sep 24 21:51:32 user sshd[12121]: Failed publickey for gitea from <my ip> port <port> ssh2: ED25519 SHA256:+5B4xxxxxxxxxxxxxxxxxxxxxxxxx
Sep 24 21:51:32 user sshd[12121]: Connection closed by authenticating user gitea <my ip> port <port> [preauth]
Pour information j’ai lu et essayé d’appliquer sans succès les réponses proposées dans les tickets suivants :