Debian11 切换Root登录

2021-11-14T18:09:27

一、打开终端,用普通用户登录

输入:su
输入密码,切换到root用户

二、设置root用户登录

nano /etc/ssh/sshd_config

三、修改配置

  1. 修改sshd_config文件,命令为:

    nano  /etc/ssh/sshd_config
  2. 将#PasswordAuthentication no的注释去掉,并且将no修改为yes
  3. 将#PermitRootLogin prohibit-password的注释去掉,将prohibit-password改为yes
  4. 启动SSH服务,命令为:/etc/init.d/ssh start // 或者service ssh start
  5. 验证SSH服务状态,命令为:/etc/init.d/ssh status
当前页面是本站的「Baidu MIP」版。发表评论请点击:完整版 »