建议不要开启, SSH登录才是更好的选择

https://www.opencli.com/linux/ubuntu-enable-root-login-ssh

基於保安理由, Ubuntu 預設不能用 root 登入 ssh, 但如果是用作內部測試的主機, 為了方便使用, 可以用以下方法解除限制:

首先要重新設定 Ubuntu 的 root 密碼, 輸入以下指令:

$ sudo passwd root

修改了 root 密碼後, 開啟 sshd 的設定檔:

$ sudo vi /etc/ssh/sshd_config

找到以下一行:

PermitRootLogin prohibit-password

改為:

PermitRootLogin yes

儲存檔案及離開編輯器, 重新啟動 sshd:

$ sudo systemctl restart sshd

重新啟動 sshd 後, 便可以用 root 帳號發入 ssh.

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2022-02-12
  • 2022-02-07
  • 2021-11-17
  • 2022-02-22
猜你喜欢
  • 2021-09-05
  • 2022-12-23
  • 2021-08-14
  • 2021-10-14
  • 2022-12-23
  • 2022-01-20
相关资源
相似解决方案