ubuntu20.04开启root权限登陆

  • 内容
  • 相关

1、使用普通用户登录后切换root

sudo -i 

 

2、修改root的密码

echo root:123123 |sudo chpasswd root

 

3、开启root登录

sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config

 

4、开启密码验证

sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config

 

5、重启ssh服务

service sshd restart

错误问题: 

ubuntu启动SSH服务出现“Failed to start sshd.service: Unit sshd.service not found.”

解决方法:

添加系统服务: ssh.service

执行代码:

systemctl enable ssh.service
黑蜘蛛

本文标签:

版权声明:若无特殊注明,本文皆为《ღ軍尐ღ》原创,转载请保留文章出处。

字数统计:本文共有 《450》 个。

本文链接:ubuntu20.04开启root权限登陆 - https://4dn.net/jsxx/286.html