Who can help me solve the SSH authentication issue? #22444
-
Hi everyone, I deployed a code repository on a local server, using gitlab. I know this is the github community, but the problem I encountered seems to be about SSH authentication. This is the log of ssh:
I have added the public key to the gitlab page, but when verifying the authentication, I still need to enter a password. I am a little confused. Who can give me some ideas?
I have set the SSH repository address to origin, but when I execute git push again, it still prompts me that I need a password. I used public key password and gitlab user password respectively, and it doesn’t work. I’m wondering, what password is needed? Excuse me for any possible offence. |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
This issue has been resolved. |
Beta Was this translation helpful? Give feedback.
-
wajika:
That means the SSH key isn’t configured correctly: Maybe the server doesn’t recognize the one you want, or the client doesn’t use it. The log shows the client offering
wajika:
Configuring SSH on the server-side is still system-specific, so I think you might have better luck in the GitLab forum. |
Beta Was this translation helpful? Give feedback.
-
Yes, I also suspect that the SSH key is wrong, but I have recreated it many times and the result is the same.
I’d like to understand where to look for the problem.
I posted on the gitlab forum and no one seems to answer. It would be great if anyone here can answer |
Beta Was this translation helpful? Give feedback.
-
wajika:
This is a red herring: If the public key authentication is set up correctly, you won’t be asked for a password, other than possibly the passphrase for the key. The only generic things I can think of here is:
|
Beta Was this translation helpful? Give feedback.
-
Yes. I entered ssh public passphrase, it didn’t work, I also executed “ssh-add ~/.ssh/id_ed25519”.
|
Beta Was this translation helpful? Give feedback.
-
I found a working method, which is to upload via http, but I still want to know why the SSH method does not work. |
Beta Was this translation helpful? Give feedback.
-
update progress According to note_20478658 prompt, I checked the /var/log/auth.log log and found that there are a large number of “Failed password for invalid user git” records from my PC (192.168.4.228). What does this mean? Do I need to create a git user on the git server? /var/log/auth.log snippet
I created a git user, but it says that the code repository cannot be found.
-------------update-------------- I started it with docker-compose, and I redeployed once and this problem still occurs.
I am using push on the server deployed by yum, everything is normal.
|
Beta Was this translation helpful? Give feedback.
This issue has been resolved.
The cause of the problem is that if you use a non-SSH22 port, you need to add the gitlab_shell_ssh_port parameter.