Debian默认是不允许root登录的

一、用户普通用户登录,打开终端,输入 命令 su root 回车,

输入root密码 回车 切换到root账号

image.png

二,设置root用户登录

vi /etc/ssh/sshd_config

修改配置

将PasswordAuthentication no的注释去掉,并且将no修改为yes

将#PermitRootLogin prohibit-password的注释去掉,将prohibit-password改为yes

image.png

三、 先关闭ssh服务,然后开启shh服务

sudo systemctl stop ssh
 sudo systemctl start ssh