Ubuntu使用root用户ssh登录
美丽新科技BLOG

Ubuntu使用root用户ssh登录

刘纪彤
1年前发布

Ubuntu使用root用户ssh登录

测试版本:Ubuntu 22.04LTS

安装openssh-server

sudo apt install openssh-server

设置root用户密码

sudo passwd root

修改sshd_config文件

sudo vim /etc/ssh/sshd_config

使用vim编辑器打开sshd_config文件,找到PermitRootLogii这一行,将改为yes,保存并退出。并将前后共几行的内容改成如下所示:

 LoginGraceTime 2m
 PermitRootLogin yes
 StrictModes yes
 #MaxAuthTries 6
 #MaxSessions 10

重启ssh服务

sudo service ssh restart
喜欢就支持一下吧
点赞 0 分享 收藏
评论 抢沙发
OωO
取消