今天在笔记本上配置项目。
但ssh key怎么也连不上
使用ssh -vT git@git.github.com
找到了错误debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
网上有两种解决方案
- 修改MTU,改小数值,
尝试后无效 - 偶然发现一个帖子,修改
/etc/ssh/ssh_config,试验有效
解决办法:
按如下内容,修改/etc/ssh/ssh_config
# $OpenBSD: ssh_config,v 1.34 2019/02/04 02:39:42 dtucker Exp $
# This is the ssh client system-wide configuration file. See
# ssh_config(5) for more information. This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.
# Configuration data is parsed as follows:
# 1. command line options
# 2. user-specific file
# 3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.
# Site-wide defaults for some commonly used options. For a comprehensive
# list of available options, their meanings and defaults, please see the
# ssh_config(5) man page.
Host *
# ForwardAgent no
# ForwardX11 no
# PasswordAuthentication yes
# HostbasedAuthentication no
# GSSAPIAuthentication no
# GSSAPIDelegateCredentials no
# BatchMode no
# CheckHostIP yes
# AddressFamily any
# ConnectTimeout 0
# StrictHostKeyChecking ask
# IdentityFile ~/.ssh/id_rsa
# IdentityFile ~/.ssh/id_dsa
# IdentityFile ~/.ssh/id_ecdsa
# IdentityFile ~/.ssh/id_ed25519
# Port 22
# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc
MACs hmac-md5,hmac-sha1,umac-64@openssh.com
# EscapeChar ~
# Tunnel no
# TunnelDevice any:any
# PermitLocalCommand no
# VisualHostKey no
# ProxyCommand ssh -q -W %h:%p gateway.example.com
# RekeyLimit 1G 1h
# Added by git-extra
Ciphers +aes128-cbc,3des-cbc,aes256-cbc,aes192-cbc
#Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
#MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
SendEnv LANG LC_*
HashKnownHosts yes
GSSAPIAuthentication yes
GSSAPIDelegateCredentials no
HostKeyAlgorithms ssh-rsa,ssh-dss
windows上用git,需要装git bash,在git bash内,有虚拟环境,/etc/ssh/ssh_config 文件路径不变。
本文详细介绍了在配置项目过程中遇到的SSH连接GitHub失败的问题及解决方法。通过调整/etc/ssh/ssh_config文件中的设置,成功解决了连接问题,适用于Windows环境下使用Git Bash的用户。
703

被折叠的 条评论
为什么被折叠?



