-------------------------------------

设置root管理员账户密码:

sudo passwd root

输入普通用户密码后修改。

修改后退出,用root登录


安装远程服务:

$ sudo apt-get install openssh-server

$ sudo /etc/init.d/ssh restart


检查服务状态:

systemctl --failed



Server responded "Algorithm negotiation faild."无法远程,


vi /etc/ssh/sshd_config  

最后添加如下信息:

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




无法用root远程,可以对 openssh server进行配置

$ sudo vi /etc/ssh/sshd_config

找到PermitRootLogin 一行,改为PermitRootLogin yes




添加和静态ip有关的参数,注释动态DNS:


# The primary network interface


iface eth0 inet static


address 192.168.1.247


netmask 255.255.255.0


gateway 192.168.1.2


$sudo ifdown eth0


$sudo ifup eth0


测试链接:正常。



附下边查资料参考的页面:

安装 openssh-server后,使用ssh客户端连接时可能报此错误,情况如下图所示

Ubuntu配置新安装配置折腾好大一会_信息

server responded "algorithm negotiation failed”

Ubuntu配置新安装配置折腾好大一会_管理员_02

解决方法

修改ssh的配置文件 /etc/ssh/sshd_config


Ubuntu配置新安装配置折腾好大一会_用户_03

在配置文件中添加:



Ubuntu配置新安装配置折腾好大一会_信息_04

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



Ubuntu配置新安装配置折腾好大一会_密码_05

重启sshd服务后


Ubuntu配置新安装配置折腾好大一会_用户_06

就可正常连接了

Ubuntu配置新安装配置折腾好大一会_用户_07

传送个Python试一下

Ubuntu配置新安装配置折腾好大一会_密码_08