ubuntu 16.4开启ssh服务

来源:互联网 发布:网络什么赌博平台热门 编辑:程序博客网 时间:2024/05/22 19:07

1、安装 OpenSSH Server(sudo apt-get install openssh-server) ;

2、使用SSH Secure Shell Client连接ubuntu,提示 server responded "algorithm negotiation failed",则需要修改/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

且需要将/etc/ssh/sshd_config文件中

PermitRootLogin prohibit-password修改为PermitRootLogin yes (如果该文件无法修改,参考一下步骤,a、sudo passwd root;b、设置root用户的密码;c、su - root 切换至root用户,再使用vi /etc/ssh/sshd_config)

4、修改配置并保存后,重新启动SSH服务 
sudo service ssh restart

5、使用SSH Secure Shell Client可连接至ubuntu主机

0 0
原创粉丝点击