操作系统

debian10开启root远程登录

hadeschan · 11月28日 · 2020年 本文共539个字 · 预计阅读2分钟 9次已读
朗读本文

null
最小化安装debian系统后,ssh远程登录服务默认是关闭且禁止直接使用root账户进行登录。那么我们要如何开启ssh服务并允许root账户登录呢?下面自然简单说一下两种操作方式,适用于代码强迫症患者和小白使用。
代码如下

标准的操作

编辑sshd_config文件,
vi /etc/ssh/sshd_config
将#PasswordAuthentication no的注释去掉,改为PasswordAuthentication yes
将#PermitRootLogin prohibit-password的注释去掉,并改为PermitRootLogin yes
启动SSH服务,命令为:/etc/init.d/ssh start // 或者service ssh start
验证SSH服务状态,命令为:/etc/init.d/ssh status
添加开机自启动 update-rc.d ssh enable
懒人模式
直接使用cat命令在sshd_config文件尾部追加所需要的内容就行,反正上面都是#注释的,不会造成任何冲突。
cat >> /etc/ssh/sshd_config << EOF
PasswordAuthentication yes
PermitRootLogin yes
EOF
service ssh restart
0 条回应

必须 注册 为本站用户, 登录 后才可以发表评论!

欢迎使用FAQ检索服务,请输入关键词开始检索