異常解決——GitLab : ssh: connect to host port 22: Connection refused
問題:
自己搭了一個Gitlab伺服器,在把本地專案上傳到gitlab上,進行push的時候,提示ssh: connect to host port 22: Connection refused
如下圖:
分析:
開始在網上找答案,都是提示防火牆關閉了,讓我telnet試試,都正常。但是push還是被拒絕。 後面考慮到 伺服器ip 是192.168.10.106 , 但是我配置使用的是localhost。 gitlab的地址是:git@localhost:qifu_develop/qifu-project-v1.0/qifu-customer.git
遂考慮改成伺服器IP,參考:https://www.cnblogs.com/kaneyang/p/7090923.html
解決方案:
既然猜想問題出在ip訪問的時候,那麼更改git伺服器地址為ip地址。 同時,將remote的遠端url更改 成新的git地址,git命令如下(兩句命令,先刪除,後add):
git remote rm origin
git remote add origin [url]
然後重新add ,commit , push 。成功提交,問題解決。
其他問題方案解決:
1、The authenticity of host can't be established. 如若遇到這類問題,則說明你的本機./ssh 目錄的密碼檔案缺少了known_hosts檔案,你只需要輸入yes回車即可生成! 參考:https://www.jianshu.com/p/629fefe5468a
2、提示沒許可權, 在設定專案使用者的許可權的時候,大部分人喜歡設定成Developer (開發者),但是開發者是沒有push許可權的。 一般設定成master 或者 給Developer賦予push許可權即可解決。
3、另外如果沒有設定公私祕鑰的話, 請參考:https://www.cnblogs.com/superGG1990/p/6844952.html
Git 是很強大的版本控制工具,希望大家使用愉快~
相關文章
- ssh: connect to host localhost port 22: Connection refusedlocalhost
- 坑:ssh: connect to host github.com port 22: Connection refusedGithub
- ubuntu ssh: connect to host ** port 22: Connection refused ssh登入遠端伺服器時提示Permission denied (publickey,password)Ubuntu伺服器
- The connection to the server 10.10.0.2:6443 was refused - did you specify the right host or port?Server
- 解決 Android studio Connect to 127.0.0.1:[/127.0.0.1] failed: Connection refusedAndroid127.0.0.1AI
- Error:Can't connect to SOCKS proxy:Connection refused (Connection refused)Error
- 解決Mac終端下載報錯 curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refusedMacAIGithub
- java.net.ConnectException: Connection refused 異常JavaException
- raw.githubusercontent.com port 443: Connection refusedGithub
- go get報錯connect: connection refusedGo
- 解決telnet: connect to address 127.0.0.1: Connection refused的錯誤資訊問題127.0.0.1
- SSH出現Connection refused錯誤
- telnet localhost 44444 telnet: connect to address ::1: Connection refusedlocalhost
- nacos Connection refused (Connection refused)
- Linux啟動tomcat後執行shutdown.sh關閉時出現異常:Connection refused (Connection refused)LinuxTomcat
- ssh 遠端登入報錯:Unable to negotiate with IP port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss 解決辦法Go
- Solaris SSH 服務處於maintenance模式,ssh connection refusedAINaN模式
- Unable to negotiate with xx.xxx.xxxx port 22: no matching host key type found. Their offer: ssh-rsa(解決的兩種方式)Go
- java.net.ConnectException: Connection refused (Connection refused)JavaException
- wsl docker 安裝frp內網穿透出現error: dial tcp 127.0.0.1:xxxx: connect: connection refused解決方法DockerFRP內網穿透ErrorTCP127.0.0.1
- Host 'xxx' is not allowed to connect to this MySQL server 解決方法MySqlServer
- (20200916 Solved)Docker||redis-cli Could not connect to Redis at 127.0.0.1:6379: Connection refusedDockerRedis127.0.0.1
- Mysql host is blocked because of many connection errors;unblock解決方法MySqlBloCError
- ssh連線遠端伺服器出現Host key verification failed. lost connection問題的解決伺服器AI
- Java RMI遇到的Connection refused to Host: 127.x.x.x/192.x.x.x/10.x.x.x問題解決方法Java
- 解決MySql報錯:1130 - Host ‘xxx‘ is not allowed to connect to this MySQL server的方法MySqlServer
- Connection could not be established with host 求救
- 聊聊jdk httpclient的connect timeout異常JDKHTTPclient
- 解決一次gitlab因異常關機導致啟動失敗Gitlab
- Ionic異常及解決
- nameko shell 報錯 : [Errno 111] Connection refused
- Error!: SQLSTATE[HY000] [2002] Connection refusedErrorSQL
- docker phpmyadmin 連線宿主mysql資料庫報錯:mysqli::real_connect(): (HY000/2002): Connection refusedDockerPHPMySql資料庫
- Please specify (single) host string for connection:
- “Host ‘xxxx‘ is not allowed to connect to this MySQL server“MySqlServer
- Host 'localhost' is not allowed to connect to this MySQL serverlocalhostMySqlServer
- 免密scp解決ssh_exchange_identification:read connection reset by peer 原因IDE
- 【bash】關於 /dev/(tcp|udp)/${HOST}/${PORT}devTCPUDP