1. 程式人生 > >使用Xshell 5工具連接Ubuntu18服務器

使用Xshell 5工具連接Ubuntu18服務器

server true roo class perm without 命令 圖片 等待

1.安裝SSH

打開終端窗口,輸入命令

sudo apt-get install openssh-server

 等待安裝完成

2.查看SSH服務是否啟動

輸入命令

sudo ps -e |grep ssh  

 看到SSHD則說明服務已經啟動,如下圖

技術分享圖片

如果沒有啟動,輸入命令

sudo service ssh start

3.修改配置文件

輸入命令

sudo gedit /etc/ssh/sshd_config

把配置文件中的"PermitRootLogin without-password"加一個"#"號註釋掉,再增加一句"PermitRootLogin yes",保存文件,如下圖。這樣做是為了允許root用戶登錄。

或者直接把下面的內容復制到配置文件中

------------------------------內 容------------------------------
# Authentication:
LoginGraceTime 120
#PermitRootLogin without-password
PermitRootLogin yes
StrictModes yes
------------------------------內 容------------------------------

技術分享圖片

4.重新啟動

/etc/init.d/ssh restart

5.查看ip地址  

ifconfig

技術分享圖片

6.安裝Xshell 5

7.連接

技術分享圖片

技術分享圖片

root用戶

技術分享圖片

技術分享圖片

使用Xshell 5工具連接Ubuntu18服務器