编程知识 cdmana.com

Exception resolution -- gitlab: SSH: connect to host port 22: connection reused

problem :

I made one myself Gitlab The server , Uploading local projects to gitlab On , Conduct push When , Tips ssh: connect to host port 22: Connection refused

Here's the picture :

analysis :

Start looking for answers online , It's all a reminder that the firewall is off , Let me telnet try , All normal . however push Or rejected . After that, we have to consider The server ip yes 192.168.10.106 , But I configured it with localhost. gitlab The address is :git@localhost:qifu_develop/qifu-project-v1.0/qifu-customer.git

So consider changing it to a server IP, Reference resources :https://www.cnblogs.com/kaneyang/p/7090923.html

Solution :

Since the guess is that the problem is ip At the time of the visit , So change git The server address is ip Address . meanwhile , take remote Remote url change Into a new git Address ,git The order is as follows ( Two commands , Delete first , after add):

git remote rm origin

git remote add origin [url]

And then again add ,commit , push . Successfully submitted , Problem solving .

Solutions to other problems :

1、The authenticity of host can't be established. If you encounter such problems , It means that your machine ./ssh The password file in the directory is missing known_hosts file , You just need to type yes Press enter to generate ! Reference resources :https://www.jianshu.com/p/629fefe5468a

2、 The prompt has no authority , When setting permissions for project users , Most people like to set it to Developer ( developer ), But developers don't have push The powers of the . Generally set to master perhaps to Developer give push The authority can solve the problem .

3、 In addition, if there is no public or private key set , Please refer to :https://www.cnblogs.com/superGG1990/p/6844952.html

Git It's a powerful version control tool , I hope you have a good time ~

Participation of this paper Tencent cloud media sharing plan , You are welcome to join us , share .

版权声明
本文为[The blank of writing memory]所创,转载请带上原文链接,感谢
https://cdmana.com/2020/12/20201224104024011s.html

Scroll to Top