authorized_keys (external SSH) #4531

Closed
opened 2025-11-02 05:53:36 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @HowToMeetLadies on GitHub (Dec 21, 2019).

  • Gitea version (or commit ref): Gitea version 1.10.1 built with GNU Make 4.1, go1.13.4 : bindata, sqlite, sqlite_unlock_notify
  • Git version: git version 2.11.0
  • Operating system: Debian Stretch - Linux HOSTNAME 5.1.14-xen #5114 SMP Sat Jun 22 15:59:13 CEST 2019 x86_64 GNU/Linux
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
HOSTNAME:/home/git$ gitea -c /etc/gitea/app.ini admin regenerate keys
2019/12/21 19:58:54 ...dules/setting/git.go:87:newGit() [I] Git Version: 2.11.0
2019/12/21 19:58:54 .../xorm/session_raw.go:76:queryRows() [I] [SQL] SELECT `id`, `owner_id`, `name`, `fingerprint`, `content`, `mode`, `type`, `login_source_id`, `created_unix`, `updated_unix` FROM `public_key` - took: 1.897202ms
HOSTNAME:/home/git$ cat .ssh/authorized_keys
HOSTNAME:/home/git$

Description

I have two keys in my account. The link on the administration page reports success, but the file remains empty.

The same via the command line: no error, empty file.

Permissions are correct. Gitea on the command line would criticize this - tested it.

SELECT * FROM public_key;
Nothing.

Gitea starts with gitea.service and gitea.main.socket and everything else appears to be working as far as it is.

In gitea.service I also removed USER and HOME from the environment, but no change. (#5795)

/etc/passwd: git:x:UID:GID:Git Version Control,,,:/home/git:/bin/bash

There is only one gitea.db in the whole system: /var/lib/gitea/data/gitea.db.

Screenshots

gitea

app.ini

APP_NAME = git
RUN_USER = git
RUN_MODE = prod

[oauth2]
JWT_SECRET = affeaffedeadbeefcafebabe

[security]
INTERNAL_TOKEN = affeaffedeadbeefcafebabe
INSTALL_LOCK   = true
SECRET_KEY     = affeaffedeadbeefcafebabe

[database]
DB_TYPE  = sqlite3
HOST     = 127.0.0.1:3306
NAME     = gitea
USER     = gitea
PASSWD   =
SSL_MODE = disable
CHARSET  = utf8
PATH     = /var/lib/gitea/data/gitea.db

[repository]
ROOT = /home/git/gitea-repositories

[server]
SSH_DOMAIN       = localhost
DOMAIN           = localhost
HTTP_PORT        = 8081
ROOT_URL         = https://your.domain/
DISABLE_SSH      = false
SSH_PORT         = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = /var/lib/gitea/data/lfs
LFS_JWT_SECRET   = affeaffedeadbeefcafebabe
OFFLINE_MODE     = false

[mailer]
ENABLED = false

[service]
REGISTER_EMAIL_CONFIRM            = false
ENABLE_NOTIFY_MAIL                = false
DISABLE_REGISTRATION              = true
ALLOW_ONLY_EXTERNAL_REGISTRATION  = false
ENABLE_CAPTCHA                    = false
REQUIRE_SIGNIN_VIEW               = true
DEFAULT_KEEP_EMAIL_PRIVATE        = true
DEFAULT_ALLOW_CREATE_ORGANIZATION = false
DEFAULT_ENABLE_TIMETRACKING       = true
NO_REPLY_ADDRESS                  = noreplay.your.domain

[picture]
DISABLE_GRAVATAR        = false
ENABLE_FEDERATED_AVATAR = true

[openid]
ENABLE_OPENID_SIGNIN = false
ENABLE_OPENID_SIGNUP = false

[session]
PROVIDER = file

[log]
MODE      = file
LEVEL     = info
ROOT_PATH = /var/lib/gitea/log

[indexer]
REPO_INDEXER_ENABLED = true
REPO_INDEXER_PATH = indexers/repos.bleve
UPDATE_BUFFER_LEN = 20
MAX_FILE_SIZE = 1048576
REPO_INDEXER_INCLUDE =
REPO_INDEXER_EXCLUDE = **/bin/**,**/sbin/**,**/lib/**

What's wrong here?

P.S: HOSTNAME, UID, GID have been replaced by me.

Originally created by @HowToMeetLadies on GitHub (Dec 21, 2019). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): `Gitea version 1.10.1 built with GNU Make 4.1, go1.13.4 : bindata, sqlite, sqlite_unlock_notify` - Git version: `git version 2.11.0` - Operating system: `Debian Stretch - Linux HOSTNAME 5.1.14-xen #5114 SMP Sat Jun 22 15:59:13 CEST 2019 x86_64 GNU/Linux` - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ``` HOSTNAME:/home/git$ gitea -c /etc/gitea/app.ini admin regenerate keys 2019/12/21 19:58:54 ...dules/setting/git.go:87:newGit() [I] Git Version: 2.11.0 2019/12/21 19:58:54 .../xorm/session_raw.go:76:queryRows() [I] [SQL] SELECT `id`, `owner_id`, `name`, `fingerprint`, `content`, `mode`, `type`, `login_source_id`, `created_unix`, `updated_unix` FROM `public_key` - took: 1.897202ms HOSTNAME:/home/git$ cat .ssh/authorized_keys HOSTNAME:/home/git$ ``` ## Description I have two keys in my account. The link on the administration page reports success, but the file remains empty. The same via the command line: no error, empty file. Permissions are correct. Gitea on the command line would criticize this - tested it. SELECT * FROM public_key; Nothing. Gitea starts with gitea.service and gitea.main.socket and everything else appears to be working as far as it is. In gitea.service I also removed USER and HOME from the environment, but no change. (#5795) `/etc/passwd: git:x:UID:GID:Git Version Control,,,:/home/git:/bin/bash` There is only one gitea.db in the whole system: /var/lib/gitea/data/gitea.db. ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** --> ![gitea](https://user-images.githubusercontent.com/755996/71312564-a6927b00-242c-11ea-816a-468ee2db54da.png) ## app.ini ``` APP_NAME = git RUN_USER = git RUN_MODE = prod [oauth2] JWT_SECRET = affeaffedeadbeefcafebabe [security] INTERNAL_TOKEN = affeaffedeadbeefcafebabe INSTALL_LOCK = true SECRET_KEY = affeaffedeadbeefcafebabe [database] DB_TYPE = sqlite3 HOST = 127.0.0.1:3306 NAME = gitea USER = gitea PASSWD = SSL_MODE = disable CHARSET = utf8 PATH = /var/lib/gitea/data/gitea.db [repository] ROOT = /home/git/gitea-repositories [server] SSH_DOMAIN = localhost DOMAIN = localhost HTTP_PORT = 8081 ROOT_URL = https://your.domain/ DISABLE_SSH = false SSH_PORT = 22 LFS_START_SERVER = true LFS_CONTENT_PATH = /var/lib/gitea/data/lfs LFS_JWT_SECRET = affeaffedeadbeefcafebabe OFFLINE_MODE = false [mailer] ENABLED = false [service] REGISTER_EMAIL_CONFIRM = false ENABLE_NOTIFY_MAIL = false DISABLE_REGISTRATION = true ALLOW_ONLY_EXTERNAL_REGISTRATION = false ENABLE_CAPTCHA = false REQUIRE_SIGNIN_VIEW = true DEFAULT_KEEP_EMAIL_PRIVATE = true DEFAULT_ALLOW_CREATE_ORGANIZATION = false DEFAULT_ENABLE_TIMETRACKING = true NO_REPLY_ADDRESS = noreplay.your.domain [picture] DISABLE_GRAVATAR = false ENABLE_FEDERATED_AVATAR = true [openid] ENABLE_OPENID_SIGNIN = false ENABLE_OPENID_SIGNUP = false [session] PROVIDER = file [log] MODE = file LEVEL = info ROOT_PATH = /var/lib/gitea/log [indexer] REPO_INDEXER_ENABLED = true REPO_INDEXER_PATH = indexers/repos.bleve UPDATE_BUFFER_LEN = 20 MAX_FILE_SIZE = 1048576 REPO_INDEXER_INCLUDE = REPO_INDEXER_EXCLUDE = **/bin/**,**/sbin/**,**/lib/** ``` ## What's wrong here? P.S: HOSTNAME, UID, GID have been replaced by me.
Author
Owner

@HowToMeetLadies commented on GitHub (Dec 21, 2019):

Shame on me. The url (nginx) pointed to another machine. faceplause

It runs all the time. Please excuse the disturbance.

I am a former gitolite user and it was perfectly fine there, but gitea is simply awesome.

🥇

@HowToMeetLadies commented on GitHub (Dec 21, 2019): Shame on me. The url (nginx) pointed to another machine. *faceplause* **It runs all the time**. Please excuse the disturbance. I am a former gitolite user and it was perfectly fine there, but gitea is simply awesome. 🥇
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4531