背景
可能是中國內地網(wǎng)絡環(huán)境的原因,Git通過ssh推送到自己的存儲庫發(fā)生以下錯誤。大概是github.com的22端口被屏蔽了?
root@yst-ubuntu:~/dev-chaos-test-system/chaos-test-system# git push origin dev
ssh: connect to host github.com port 22: Connection refused
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
通過HTTPS也不行,以下錯誤提示大意是 2021-08-13 密碼認證被移除了。官方中文文檔 文檔里似乎沒說密碼認證被移除這回事
root@yst-ubuntu:~/dev-chaos-test-system/chaos-test-system# git push hub_https dev
Username for 'https://github.com': YuSitong1999
Password for 'https://YuSitong1999@github.com':
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/YuSitong1999/chaos-test-system.git/'
解決
官方文檔: 在 HTTPS 端口使用 SSH文章來源:http://www.zghlxwxcb.cn/news/detail-816532.html
鏈接格式和GitHub提供的前兩條HTTPS和SSH鏈接不一樣。文章來源地址http://www.zghlxwxcb.cn/news/detail-816532.html
https://github.com/YuSitong1999/chaos-test-system.git
git@github.com:YuSitong1999/chaos-test-system.git
ssh://git@ssh.github.com:443/YuSitong1999/chaos-test-system.git
到了這里,關于Git推送到Guthub錯誤:ssh: connect to host github.com port 22: Connection refused的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!