I've added my root key to gitea, but why can't I still pull code without a password? #5029

Closed
opened 2025-11-02 06:11:49 -06:00 by GiteaMirror · 15 comments
Owner

Originally created by @pptfz on GitHub (Mar 9, 2020).

My system is centos7.7
I add the repository using SSH
git remote add origin git@10.0.0.10:pptfz/test.git

I've added my root key to gitea, but why can't I still pull code without a password?

Originally created by @pptfz on GitHub (Mar 9, 2020). My system is centos7.7 I add the repository using SSH git remote add origin git@10.0.0.10:pptfz/test.git I've added my root key to gitea, but why can't I still pull code without a password?
GiteaMirror added the type/questionissue/stale labels 2025-11-02 06:11:49 -06:00
Author
Owner

@dacheng-gao commented on GitHub (Mar 9, 2020):

What did your get from the terminal

@dacheng-gao commented on GitHub (Mar 9, 2020): What did your get from the terminal
Author
Owner

@pptfz commented on GitHub (Mar 10, 2020):

I've added the key, but I'm still prompted to enter the password

[root@test1 test]# git push origin master
git@10.0.0.10's password:

@pptfz commented on GitHub (Mar 10, 2020): I've added the key, but I'm still prompted to enter the password [root@test1 test]# git push origin master git@10.0.0.10's password:
Author
Owner

@lunny commented on GitHub (Mar 10, 2020):

you can try ssh -vvv git@10.0.0.10

@lunny commented on GitHub (Mar 10, 2020): you can try `ssh -vvv git@10.0.0.10`
Author
Owner

@lunny commented on GitHub (Mar 10, 2020):

Can you confirm that you have put your private key on the right place?

@lunny commented on GitHub (Mar 10, 2020): Can you confirm that you have put your private key on the right place?
Author
Owner

@pptfz commented on GitHub (Mar 10, 2020):

I confirm that my operation is correct, because I have the same operation on github, there is no problem, this may be gitea still need some other configuration I did not complete
I just checked some information on the Internet to modify the gitea configuration file app.ini, and then added the following line under [server], START_SSH_SERVER, to enable the internal SSH service, but there is no effect after restarting gitea, the push code still prompts for the password

@pptfz commented on GitHub (Mar 10, 2020): I confirm that my operation is correct, because I have the same operation on github, there is no problem, this may be gitea still need some other configuration I did not complete I just checked some information on the Internet to modify the gitea configuration file app.ini, and then added the following line under [server], START_SSH_SERVER, to enable the internal SSH service, but there is no effect after restarting gitea, the push code still prompts for the password
Author
Owner

@lunny commented on GitHub (Mar 10, 2020):

It seems you haven't put your private key on your local machine.

debug1: Trying private key: /root/.ssh/id_dsa
debug3: no such identity: /root/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /root/.ssh/id_ecdsa
debug3: no such identity: /root/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /root/.ssh/id_ed25519
debug3: no such identity: /root/.ssh/id_ed25519: No such file or directory
@lunny commented on GitHub (Mar 10, 2020): It seems you haven't put your private key on your local machine. ``` debug1: Trying private key: /root/.ssh/id_dsa debug3: no such identity: /root/.ssh/id_dsa: No such file or directory debug1: Trying private key: /root/.ssh/id_ecdsa debug3: no such identity: /root/.ssh/id_ecdsa: No such file or directory debug1: Trying private key: /root/.ssh/id_ed25519 debug3: no such identity: /root/.ssh/id_ed25519: No such file or directory ```
Author
Owner

@pptfz commented on GitHub (Mar 10, 2020):

I just made sure again that I created a repository on github called test, added my key to the repository, and then pushed the code using password-free methods
So it must be that I lack the relevant configuration of gitea or my configuration is not correct

@pptfz commented on GitHub (Mar 10, 2020): I just made sure again that I created a repository on github called test, added my key to the repository, and then pushed the code using password-free methods So it must be that I lack the relevant configuration of gitea or my configuration is not correct
Author
Owner

@guillep2k commented on GitHub (Mar 10, 2020):

A basic question: if you enter your password.... does it complete successfully?

@guillep2k commented on GitHub (Mar 10, 2020): A basic question: if you enter your password.... does it complete successfully?
Author
Owner

@guillep2k commented on GitHub (Mar 10, 2020):

It seems you haven't put your private key on your local machine.

@lunny, id_rsa does exist and is found.

@guillep2k commented on GitHub (Mar 10, 2020): > > > It seems you haven't put your private key on your local machine. @lunny, `id_rsa` does exist and is found.
Author
Owner

@pptfz commented on GitHub (Mar 10, 2020):

The way I used the SSH key should be no password input, which indicates that gitea has not been configured correctly, because my same operation is ok on github. I created a test repository on github, and then added my server key to the github repository, which is password-free login, but now it is not ok on gitea
And I entered the password as follows, but I have already executed git remote add origin git@10.0.0.10: PPTFZ /test.git

git push origin master

git@10.0.0.10 's password:
Fatal: 'PPTFZ /test.git' does not appear to be a git repository
Fatal: Could not read from remote repository.

@pptfz commented on GitHub (Mar 10, 2020): The way I used the SSH key should be no password input, which indicates that gitea has not been configured correctly, because my same operation is ok on github. I created a test repository on github, and then added my server key to the github repository, which is password-free login, but now it is not ok on gitea And I entered the password as follows, but I have already executed git remote add origin git@10.0.0.10: PPTFZ /test.git # git push origin master git@10.0.0.10 's password: Fatal: 'PPTFZ /test.git' does not appear to be a git repository Fatal: Could not read from remote repository.
Author
Owner

@guillep2k commented on GitHub (Mar 10, 2020):

Could you run the following and paste the results?

echo By port: ; netstat -ltnp | grep -w :22 ; echo By name: ; netstat -ltnp | grep -w gitea
@guillep2k commented on GitHub (Mar 10, 2020): Could you run the following and paste the results? ``` echo By port: ; netstat -ltnp | grep -w :22 ; echo By name: ; netstat -ltnp | grep -w gitea ```
Author
Owner

@pptfz commented on GitHub (Mar 10, 2020):

[root@test1 ssh-gitea]# echo By port: ; netstat -ltnp | grep -w :22 ; echo By name: ; netstat -ltnp | grep -w gitea
By port:
tcp6 0 0 :::22 :::* LISTEN 3794/sshd
By name:

My gitea was started with docker

[root@test1 ssh-gitea]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
adfdc736b707 gitea/gitea:1.11.1 "/usr/bin/entrypoint…" 2 days ago Up About an hour 0.0.0.0:3000->3000/tcp, 0.0.0.0:222->22/tcp gitea_server_1
992eced83fa9 postgres:9.6 "docker-entrypoint.s…" 2 days ago Up About an hour 5432/tcp gitea_db_1

@pptfz commented on GitHub (Mar 10, 2020): [root@test1 ssh-gitea]# echo By port: ; netstat -ltnp | grep -w :22 ; echo By name: ; netstat -ltnp | grep -w gitea By port: tcp6 0 0 :::22 :::* LISTEN 3794/sshd By name: My gitea was started with docker [root@test1 ssh-gitea]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES adfdc736b707 gitea/gitea:1.11.1 "/usr/bin/entrypoint…" 2 days ago Up About an hour 0.0.0.0:3000->3000/tcp, 0.0.0.0:222->22/tcp gitea_server_1 992eced83fa9 postgres:9.6 "docker-entrypoint.s…" 2 days ago Up About an hour 5432/tcp gitea_db_1
Author
Owner

@guillep2k commented on GitHub (Mar 11, 2020):

I don't know much about docker, but is it possible that you're redirecting port 22 to port 222? If so, maybe you need to change your command to something like:

git remote add origin ssh://git@10.0.0.10:222/pptfz/test.git
@guillep2k commented on GitHub (Mar 11, 2020): I don't know much about docker, but is it possible that you're redirecting port 22 to port 222? If so, maybe you need to change your command to something like: ``` git remote add origin ssh://git@10.0.0.10:222/pptfz/test.git ```
Author
Owner

@stale[bot] commented on GitHub (May 10, 2020):

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale[bot] commented on GitHub (May 10, 2020): This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
Author
Owner

@stale[bot] commented on GitHub (May 24, 2020):

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale[bot] commented on GitHub (May 24, 2020): This issue has been automatically closed because of inactivity. You can re-open it if needed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5029