1. 查看ssh服務器是否安裝并啟動
#sudo ps -e | grep ssh
1. 安裝ssh服務器
#sudo apt-get install openssh-server
2. 配置sshd檔案
編輯SSH服務的組態檔sshd_config,修改SSH的埠和root用戶權限,
使用到的命令:(按字母“i”進入編輯模式,按ESC退出編輯模式,“:wq”保存退出),
# vim /etc/ssh/sshd_config
1、找到# port 22所在的那一行,復制該行內容并修改,
將“#port 22”修改為“port 22”(將前面的“#”去掉),
該行內容為設定SSHd服務的埠號
2、找到#PermitRootLogin prohibit-password那一行,復制該行內容并修改,
將“#PermitRootLogin prohibit-password”修改為“PermitRootLogin yes”
3. 重啟服務器 service ssh restart
service ssh restart

轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/83081.html
標籤:Linux
