码迷,mamicode.com
首页 > 系统相关 > 详细

解除Ubuntu禁止root远程登录

时间:2019-07-06 19:37:20      阅读:189      评论:0      收藏:0      [点我收藏+]

标签:config   linu   linux   端口号   远程登录   端口   sshd_conf   star   修改   

编辑SSH服务配置文件

编辑SSH服务的配置文件sshd_config,修改SSH的端口和root用户权限。

使用到的命令:(按字母 i 进入编辑模式,按ESC退出编辑模式, :wq 保存退出)。

root@Jaking:~# vim /etc/ssh/sshd_config
1. 开放远程端口
找到 # port 22所在的那一行,复制该行内容并修改。

将 #port 22 修改为 port 22(将前面的 # 去掉)。

该行内容为设置SSHD服务的端口号
2. 允许root远程登录
找到 #PermitRootLogin prohibit-password那一行,复制该行内容并修改。

将 #PermitRootLogin prohibit-password 修改为 PermitRootLogin yes
3. 重启ssh服务
service sshd restart 或者 /etc/init.d/ssh restart

解除Ubuntu禁止root远程登录

标签:config   linu   linux   端口号   远程登录   端口   sshd_conf   star   修改   

原文地址:https://www.cnblogs.com/linuxprobe-sarah/p/11143526.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!