遇到的问题:
我在虚拟机上安装了CentOS8, 准备coding,可是在我clone代码的时候却遇到了问题,提示如下的错误,看字段的意思是好像是没有权限或代码仓库不存在。仓库肯定是存在的,因为一直在开发中,于是开始检查权限问题,经过分析权限也没问题。
Cloning into 'xxxxx'...
client_loop: send disconnect: Broken pipe
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
分析问题:
否是git服务器的问题?
通过在其他机器上测试,git服务器运行正常是否ssh的问题?
git 是通过ssh通讯的,那么先测试下ssh通讯是否正常。
通过在 ssh 后面添加-v 可以打印出详细的调试信息。
ssh -v terry@xx.xx.xxx.xx
OpenSSH_8.0p1, OpenSSL 1.1.1c FIPS 28 May 2019
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf
debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config
debug1: configuration requests final Match pass
debug1: re-parsing configuration
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf
debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config
debug1: Connecting to xx.xx.xxx.xx port 22.
debug1: Connection established.
debug1: identity file /home/wjh8/.ssh/id_rsa type 0
debug1: identity file /home/wjh8/.ssh/id_rsa-cert type -1
debug1: identity file /home/wjh8/.ssh/id_dsa type -1
debug1: identity file /home/wjh8/.ssh/id_dsa-cert type -1
debug1: identity file /home/wjh8/.ssh/id_ecdsa type -1
debug1: identity file /home/wjh8/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/wjh8/.ssh/id_ed25519 type -1
debug1: identity file /home/wjh8/.ssh/id_ed25519-cert type -1
debug1: identity file /home/wjh8/.ssh/id_xmss type -1
debug1: identity file /home/wjh8/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.0
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4
debug1: match: OpenSSH_7.4 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
debug1: Authenticating to 47.92.66.125:22 as 'terry'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: aes256-gcm@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: aes256-gcm@openssh.com MAC: <implicit> compression: none
debug1: kex: curve25519-sha256 need=32 dh_need=32
debug1: kex: curve25519-sha256 need=32 dh_need=32
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:4HOH7aogINvf8RH2K8Y9FXFQAvQfjKWTEbshVIAf2U8
The authenticity of host 'xx.xx.xx.xx' can't be established.
ECDSA key fingerprint is SHA256:4HOH7aogINvf8RH2K8Y9FXFQAvQfjKWTEbshVIAf2U8.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'xx.xx.xx.xx' (ECDSA) to the list of known hosts.
debug1: rekey out after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 4294967296 blocks
debug1: Will attempt key: /home/wjh8/.ssh/id_rsa RSA SHA256:WkZ/7Y+Kn3h+gOdv/pEFpHpQkoo5YuYzQ3kXDGXbdow agent
debug1: Will attempt key: /home/wjh8/.ssh/id_dsa
debug1: Will attempt key: /home/wjh8/.ssh/id_ecdsa
debug1: Will attempt key: /home/wjh8/.ssh/id_ed25519
debug1: Will attempt key: /home/wjh8/.ssh/id_xmss
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure. Minor code may provide more information
No Kerberos credentials available (default cache: KCM:)
debug1: Unspecified GSS failure. Minor code may provide more information
No Kerberos credentials available (default cache: KCM:)
debug1: Next authentication method: publickey
debug1: Offering public key: /home/wjh8/.ssh/id_rsa RSA SHA256:WkZ/7Y+Kn3h+gOdv/pEFpHpQkoo5YuYzQ3kXDGXbdow agent
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /home/wjh8/.ssh/id_dsa
debug1: Trying private key: /home/wjh8/.ssh/id_ecdsa
debug1: Trying private key: /home/wjh8/.ssh/id_ed25519
debug1: Trying private key: /home/wjh8/.ssh/id_xmss
debug1: Next authentication method: password
terry@xx.xx.xx.xx's password:
在这一步提示输入密码,输入密码后,后面提示,密码正确,说明远程服务器没有问题。
debug1: Authentication succeeded (password).
Authenticated to xx.xx.xx.xx:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending env XMODIFIERS = @im=ibus
client_loop: send disconnect: Broken pipe
- 至此基本可以确定就是新装的CentOS8系统自己的问题
经过一翻baidu后,终于找到了一条有价值的信息。
关于VMware虚拟机上Openssh broken问题的解决
解决办法
修改/etc/ssh/ssh_config文件,在Host *条目下添加 IPQoS=throughput
Host *
IPQoS=throughput
重新启动ssh服务
systemctl restart sshd
问题解决了,原因还不是很清楚,以后慢慢理解,在此贡献出来与大家分亨,如果帮到了你,不要忘了点赞哦!!!