-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Impossible to pull / push via ssh gitea #5497
Comments
Check your |
rights to the .ssh 700 folder and to author_keys 600 |
if I enter the password my Gitea account, then all the same nothing works, although the password is correct. |
Would you add below setting at section [server] of app.ini After apply above setting, restart gitea service, and try again in below command in git bash |
Ok, I'm assuming you have actually got openssh or some external (to gitea) SSH server running. You won't be able to run the internal SSH server on port 22 unless you have specifically allowed gitea to open that port as it's under 1000. If you want to use the internal SSH server you need to set the port to something higher like 2222. Now, assuming you're using openssh externally, where is the gitea user's home directory? You imply that it's Is it possible to actually login as the gitea user? What is the shell at the end of the gitea line in Gitea needs to own the .ssh directory and the repositories. Make sure it does. Make sure you're actually running gitea under the gitea user. Hope this helps. |
I stumbled across the same problem and for me this worked: After installing gitea on the Synology, the user Best regards, |
@ghost does this solve your issue? |
@zeripath that account has been deleted I think. |
D'oh. Ok, so in terms of resolving this issue - do we think there's anything Gitea can do here? I mean it's extremely odd that there's a system out there with a different $HOME than the one in /etc/passed. Perhaps it just needs a documentation PR? @aljole would you be able to send a documentation PR? Perhaps based in the troubleshooting section (I hope one exists) |
@lunny otherwise I think we close this issue. |
@zeripath I never did a PR before, but there's a first time for anything, right? |
I have the same setup as the deleted ghost users has and I encountered exactly the same problem. (I also followed the same installation process.) The SSH server denies my permission when authenticating by pubkey (and then prompts a password). The verbose SSH output is analogous. Unfortunately the actions described by @alsmnn did not solve the problem. Everything works fine except the pubkey authenticated SSH-login with the user gitea. Note that I can SSH into my NAS on every other user. Like @alsmnn mentioned, the user directory for gitea is in
My guess is that this is some SSH server setup issue. Somehow SSH does not find the EDIT 1 The log output:
EDIT 2 I hope this helps other users running a gitea server on their Synology NAS. |
[x]
):Description
Installed Gitea on NAS Synology DS918+
When I want to clone a repository:
git clone gitea@git.my_domain.ru:vlad.bitrix/layout.git
Cloning into 'layout'...
gitea@git.my_domain.ru's password:
Permission denied, please try again.
gitea@git.my_domain.ru's password:
gitea@git.my_domain.ru: Permission denied (publickey,password).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
If you use HTTPS:
git clone https://git.my_domain.ru:3000/vlad.bitrix/layout.git
Cloning into 'layout'...
remote: Counting objects: 2127, done.
remote: Compressing objects: 100% (650/650), done.
remote: Total 2127 (delta 1433), reused 2127 (delta 1433)
Receiving objects: 100% (2127/2127), 5.00 MiB | 7.46 MiB/s, done.
Resolving deltas: 100% (1433/1433), done.
iMac-Vlad-2:test vladbaranov$
Everything works successfully!
if you enter: ssh -v git.my_domain.ru
OpenSSH_7.6p1, LibreSSL 2.6.2
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug1: Connecting to git.my_domain.ru port 22.
debug1: Connection established.
debug1: identity file /Users/vladbaranov/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file /Users/vladbaranov/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/vladbaranov/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/vladbaranov/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/vladbaranov/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/vladbaranov/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/vladbaranov/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/vladbaranov/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4
debug1: match: OpenSSH_7.4 pat OpenSSH* compat 0x04000000
debug1: Authenticating to git.my_domain.ru:22 as 'vladbaranov'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:RocgmrS0uNfyudnDDcWDdJrgsNhKEkd5Ans9bW0rAXTn4
debug1: Host 'git.my_domain.ru' is known and matches the ECDSA host key.
debug1: Found key in /Users/vladbaranov/.ssh/known_hosts:21
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:sosF7LQODaGgdfjqwfDOpdCgaRGs4Ylva3WuygFc/Ioapk /Users/vladbaranov/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /Users/vladbaranov/.ssh/id_dsa
debug1: Trying private key: /Users/vladbaranov/.ssh/id_ecdsa
debug1: Trying private key: /Users/vladbaranov/.ssh/id_ed25519
debug1: Next authentication method: password
vladbaranov@git.my_domain.ru's password:
How I installed Gitea:
APP_NAME = Gitea: Git with a cup of tea
RUN_USER = gitea
RUN_MODE = prod
[security]
INTERNAL_TOKEN = xxxxxxxxxxx
INSTALL_LOCK = true
SECRET_KEY = xxxxxxxxxxx
[database]
DB_TYPE = mysql
HOST = 127.0.0.1:3307
NAME = gitea
USER = gitea
PASSWD =
my_pass
SSL_MODE = disable
PATH = data/gitea.db
[repository]
ROOT = /usr/local/gitea/gitea/gitea-repositories
[server]
SSH_DOMAIN = git.my_domain.ru
DOMAIN = git.my_domain.ru
HTTP_PORT = 3000
ROOT_URL = https://git.my_domain.ru:3000/
DISABLE_SSH = false
SSH_PORT = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = /usr/local/gitea/gitea/data/lfs
LFS_JWT_SECRET = xxxxxxxxx
OFFLINE_MODE = false
PROTOCOL = https
CERT_FILE = /usr/local/gitea/gitea/custom/https/cert.pem
KEY_FILE = /usr/local/gitea/gitea/custom/https/key.pem
[mailer]
ENABLED = true
HOST = mail.my_domain.ru:587
FROM = office@my_domain.ru
USER = my_login
PASSWD = my_pass
[service]
REGISTER_EMAIL_CONFIRM = false
ENABLE_NOTIFY_MAIL = true
DISABLE_REGISTRATION = false
ALLOW_ONLY_EXTERNAL_REGISTRATION = false
ENABLE_CAPTCHA = true
REQUIRE_SIGNIN_VIEW = false
DEFAULT_KEEP_EMAIL_PRIVATE = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
DEFAULT_ENABLE_TIMETRACKING = true
NO_REPLY_ADDRESS = my_domain.ru
[picture]
DISABLE_GRAVATAR = false
ENABLE_FEDERATED_AVATAR = false
[openid]
ENABLE_OPENID_SIGNIN = true
ENABLE_OPENID_SIGNUP = true
[session]
PROVIDER = file
[log]
MODE = file
LEVEL = Info
ROOT_PATH = /usr/local/gitea/gitea/log
Help please understand, for 2 days I can not understand why it does not work on SSH and works on HTTPS.
...
Screenshots
The text was updated successfully, but these errors were encountered: