SSH学习3_ssh 连接报错:debug1: expecting SSH2_MSG_KEX_ECDH_REPLY

本文解决SSH在Putty中工作但在终端上不起作用的问题。通过编辑Ubuntu 13.10/12.10中的/etc/ssh/ssh_config文件,并启用特定设置来确保SSH连接正常运行。

The solution was found here: SSH works in putty but not terminal

in Ubuntu 13.10/12.10, login and gain sudo access.

Edit /etc/ssh/ssh_config, uncomment the following lines

Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
GSSAPIAuthentication yes
GSSAPIDelegateCredentials no
MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160

Add the following line

HostKeyAlgorithms ssh-rsa,ssh-dss

You should end up with your /etc/ssh/ssh_config file looking like this

Host *
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

Now run ssh -T -v git@github.com and it will ask you to add the server to your known hosts file. Hit yes, and then it should welcome you to the server.

转自:http://www.voidcn.com/article/p-kmgjazmm-bke.html

全部日志如下 test@test:~/Desktop$ ssh -Tv git@rdgerrit.tp-link.com -p 29418 OpenSSH_8.9p1 Ubuntu-3ubuntu0.13, OpenSSL 3.0.2 15 Mar 2022 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files debug1: /etc/ssh/ssh_config line 21: Applying options for * debug1: Connecting to rdgerrit.tp-link.com [10.176.69.34] port 29418. debug1: Connection established. debug1: identity file /home/test/.ssh/id_rsa type 0 debug1: identity file /home/test/.ssh/id_rsa-cert type -1 debug1: identity file /home/test/.ssh/id_ecdsa type -1 debug1: identity file /home/test/.ssh/id_ecdsa-cert type -1 debug1: identity file /home/test/.ssh/id_ecdsa_sk type -1 debug1: identity file /home/test/.ssh/id_ecdsa_sk-cert type -1 debug1: identity file /home/test/.ssh/id_ed25519 type -1 debug1: identity file /home/test/.ssh/id_ed25519-cert type -1 debug1: identity file /home/test/.ssh/id_ed25519_sk type -1 debug1: identity file /home/test/.ssh/id_ed25519_sk-cert type -1 debug1: identity file /home/test/.ssh/id_xmss type -1 debug1: identity file /home/test/.ssh/id_xmss-cert type -1 debug1: identity file /home/test/.ssh/id_dsa type -1 debug1: identity file /home/test/.ssh/id_dsa-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.13 debug1: Remote protocol version 2.0, remote software version GerritCodeReview_3.4.6 (APACHE-SSHD-2.7.0) debug1: compat_banner: no match: GerritCodeReview_3.4.6 (APACHE-SSHD-2.7.0) debug1: Authenticating to rdgerrit.tp-link.com:29418 as 'git' debug1: load_hostkeys: fopen /home/test/.ssh/known_hosts2: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: ecdh-sha2-nistp256 debug1: kex: host key algorithm: ssh-ed25519 debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha2-256-etm@openssh.com compression: none debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha2-256-etm@openssh.com compression: none debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: SSH2_MSG_KEX_ECDH_REPLY received debug1: Server host key: ssh-ed25519 SHA256:xc8JwY4MTnouuNKig5mGjtVItTUzm5a4SR/3vcOwQg8 debug1: load_hostkeys: fopen /home/test/.ssh/known_hosts2: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory debug1: Host '[rdgerrit.tp-link.com]:29418' is known and matches the ED25519 host key. debug1: Found key in /home/test/.ssh/known_hosts:1 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: get_agent_identities: ssh_get_authentication_socket: Connection refused debug1: Will attempt key: /home/test/.ssh/id_rsa RSA SHA256:Z+Fo92LPUeoJ+cs9rlCYLmhFM2Y80EhAS3JHC/0fVPc debug1: Will attempt key: /home/test/.ssh/id_ecdsa debug1: Will attempt key: /home/test/.ssh/id_ecdsa_sk debug1: Will attempt key: /home/test/.ssh/id_ed25519 debug1: Will attempt key: /home/test/.ssh/id_ed25519_sk debug1: Will attempt key: /home/test/.ssh/id_xmss debug1: Will attempt key: /home/test/.ssh/id_dsa debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Offering public key: /home/test/.ssh/id_rsa RSA SHA256:Z+Fo92LPUeoJ+cs9rlCYLmhFM2Y80EhAS3JHC/0fVPc debug1: send_pubkey_test: no mutual signature algorithm debug1: Trying private key: /home/test/.ssh/id_ecdsa debug1: Trying private key: /home/test/.ssh/id_ecdsa_sk debug1: Trying private key: /home/test/.ssh/id_ed25519 debug1: Trying private key: /home/test/.ssh/id_ed25519_sk debug1: Trying private key: /home/test/.ssh/id_xmss debug1: Trying private key: /home/test/.ssh/id_dsa debug1: No more authentication methods to try. git@rdgerrit.tp-link.com: Permission denied (publickey).
最新发布
09-09
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值