SSH 连接Ubuntu 步骤和出现Algorithm Negotiation failed 问题

安装SSH server

(1)先访问服务器,更新可获取软件及其版本信息,然后安装SSH服务

apt-get update
apt-get install openssh-server

(2)修改SSH配置
①打开SSH配置文件

sudo vi /etc/ssh/sshd_config

②修改配置内容
在这里插入图片描述

添加PermitRootLogin yes注释掉PermitRootLogin prohibit-password
③匹配密钥交换算法
在刚才的配置文件的最后一行加入

Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256,arcfour,blowfish-cbc,cast128-cbc

MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-sha1-96,hmac-md5-96

KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-sha256@libssh.org

若上面修改配置文件如下所示在这里插入图片描述

则修改配置文件如下

KexAlgorithms +diffie-hellman-group1-sha1
Ciphers +aes128-cbc

(3)重启SSH服务

/etc/init.d/ssh start 
Logo

鸿蒙生态一站式服务平台。

更多推荐