異常解決——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
- 解決 connect to host github.com port 22 operation timed outGithub
- The connection to the server 10.10.0.2:6443 was refused - did you specify the right host or port?Server
- 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
- scp時候出現ssh Connection refused的解決方案
- java.net.ConnectException: Connection refused 異常JavaException
- java.sql.SQLException: Io 異常: Connection refusedJavaSQLException
- 解決 Android studio Connect to 127.0.0.1:[/127.0.0.1] failed: Connection refusedAndroid127.0.0.1AI
- ssh 安裝及登入提示:connection refused的解決辦法
- go get報錯connect: connection refusedGo
- raw.githubusercontent.com port 443: Connection refusedGithub
- FTP Connection refused error 解決辦法FTPError
- Solaris SSH 服務處於maintenance模式,ssh connection refusedAINaN模式
- EJB create時ConnectException: Connection refused to host:....問題Exception
- ssh 遠端登入報錯:Unable to negotiate with IP port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss 解決辦法Go
- AS編譯不通過,提示Error:Connection refused: connect編譯Error
- Gradle 編譯不通過 connection refused connectGradle編譯
- Linux啟動tomcat後執行shutdown.sh關閉時出現異常:Connection refused (Connection refused)LinuxTomcat
- 解決telnet: connect to address 127.0.0.1: Connection refused的錯誤資訊問題127.0.0.1
- java.net.ConnectException: Connection refused (Connection refused)JavaException
- ssh問題:ssh_exchange_identification: Connection closed by remote hostIDEREM
- oracle出異常:Io 異常: The Network Adapter could not establish the connection 解決辦法OracleAPT
- mysql connection refusedMySql
- ssh連線Linux收到The remote system refused the connection報錯LinuxREM
- 【轉載】Xlib: connection to ":0.0" refused by server的解決方法Server
- telnet localhost 44444 telnet: connect to address ::1: Connection refusedlocalhost
- Xlib: connection to ":0.0" refused by server Xlib: No protocol specified解決方案ServerProtocol
- Mysql host is blocked because of many connection errors;unblock解決方法MySqlBloCError
- Host 'xxx' is not allowed to connect to this MySQL server 解決方法MySqlServer
- Connection to https://dl-ssl.google.com refused的解決辦法HTTPGo
- 解決 git push Failed to connect to 127.0.0.1 port 45463: 拒絕連線GitAI127.0.0.1
- Unable to negotiate with xx.xxx.xxxx port 22: no matching host key type found. Their offer: ssh-rsa(解決的兩種方式)Go
- ssh連線遠端伺服器出現Host key verification failed. lost connection問題的解決伺服器AI
- ssh登陸 “remote host identification has changed!“ 解決方案REMIDE
- IOException in sending Request :: Connection refusedException
- Ionic異常及解決