天天看點

Ubuntu16.04 搭建ssh

一.安裝SSH-server

打開終端,使用超級使用者身份安裝ssh

ctrl+alt+t
sudo su
apt-get install openssh-server
apt-get install openssh-client
ifconfig        #檢視本機IP位址           

确認ssh是否安裝成功

ps -e | grep ssh*           

二.啟動與關閉ssh服務

sudo service ssh start  #啟動ssh
sudo service ssh stop   #關閉ssh
sudo service ssh restart  #重新開機ssh           

三.配置sshd_config

sudo gedit /etc/ssh/sshd_config  #打開配置檔案           

把配置檔案中的”PermitRootLogin without-password“前面的”#”号去除

再增加一句”PermitRootLogin yes“,

并在文本的最下方複制粘貼以下内容:

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]           

儲存,修改成功

sudo /etc/init.d/ssh restart  #重新開機ssh服務           

四.用戶端遠端連接配接

首先将ssh下載下傳到本地。

然後根據下圖所示進行操作

Ubuntu16.04 搭建ssh
Ubuntu16.04 搭建ssh

在host name 處填寫伺服器的IP位址,在user name 處填寫 使用者名,連接配接後,輸入password即可登入伺服器

Ubuntu16.04 搭建ssh
Ubuntu16.04 搭建ssh

繼續閱讀