租來的主機預設有開 root 遠端登入,這樣其實容易遭人惡意破解


  1. 編輯 /etc/ssh/sshd_config,更改

    PermitRootLogin no

  2. 若是要阻擋特定使用者使用 ssh 遠端登入

    DenyUsers root

  3. 重新啟動 ssh 服務
    sudo service ssh restart
  4. 完成!!

 

Leave a Reply