1. 程式人生 > >ubuntu 16.4開啟ssh服務

ubuntu 16.4開啟ssh服務

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,[email protected],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,
[email protected]

且需要將/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主機