Gogs - I can't connect throw ssh - publickey failed

What app is this about, and its version: 0.13.3~ynh2
What YunoHost version are you running: 12.1.37
What type of hardware are you using: Old laptop or computer

Describe your issue

I can’t clone repository using ssh, I have put my public key in my Gogs account.
Gogs asks me for a password for gogs user, but I don’t have this password.
git clone -vv gogs@yunohost-pc.local:util1/depot.git
Thank’s

Share relevant logs or error messages

2025-12-26T17:27:43.581855+01:00 yunohost-pc sshd[70220]: Failed publickey for gogs from 192.168.1.20 port 34468 ssh2: ED25519 SHA256:vaAz+p…
2025-12-26T17:27:47.123048+01:00 yunohost-pc sshd[70220]: Connection closed by authenticating user gogs 192.168.1.20 port 34468 [preauth]

2025-12-27T16:09:41.205783+01:00 yunohost-pc sshd[3200]: Connection from 192.168.1.20 port 41058 on 192.168.1.26 port 22 rdomain “”
2025-12-27T16:09:41.267473+01:00 yunohost-pc sshd[3200]: User gogs from 192.168.1.20 not allowed because none of user’s groups are listed in AllowGroups
2025-12-27T16:09:44.676487+01:00 yunohost-pc sshd[3200]: Failed none for invalid user gogs from 192.168.1.20 port 41058 ssh2
2025-12-27T16:09:46.180743+01:00 yunohost-pc sshd[3200]: Connection closed by invalid user gogs 192.168.1.20 port 41058 [preauth]

I had gogs in AllowsGroups in /etc/ssh/sshd_config
Then I restarted sshd

2025-12-27T16:20:56.053678+01:00 yunohost-pc sshd[3585]: Connection from 192.168.1.20 port 58712 on 192.168.1.26 port 22 rdomain “”
2025-12-27T16:20:56.128366+01:00 yunohost-pc sshd[3585]: Failed publickey for gogs from 192.168.1.20 port 58712 ssh2: ED25519 SHA256:vaAz+pixkaBlt***
2025-12-27T16:20:59.977171+01:00 yunohost-pc sshd[3585]: Failed none for gogs from 192.168.1.20 port 58712 ssh2
2025-12-27T16:21:01.241439+01:00 yunohost-pc sshd[3585]: Connection closed by authenticating user gogs 192.168.1.20 port 58712 [preauth]

The publickey is not accepted, it asks me for password but I don’t have.

Someone can help me please ?

Same issue here. Could not get the Yunohost sshd server working. This worked for me YMMV.

In the Gogs web app add your ssh key.

ssh into your yunohost server

$ sudo su

# nano /var/www/gogs/custom/conf/app.ini

In the [server] section change:

START_SSH_SERVER = true

SSH_PORT = 2222 # Use a different port than your Yunohost sshd server

# yunohost service restart gogs

In the Yunohost admin web app go to > Tools > Firewall

Under Operations add/open the tcp port you chose for gogs.

1 Like

Thank’s a lot ! It works now.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.