Quantcast
Channel: CodeSection,代码区,Linux操作系统:Ubuntu_Centos_Debian - CodeSec
Viewing all articles
Browse latest Browse all 11063

Linux禁止ROOT从ssh远程登陆

$
0
0

分类:linux 时间: 2016年2月29日

Linux系统默认情况下ROOT是可以通过ssh远程登录的。但出于安全考虑,一般建议禁止ROOT从ssh远程登陆,因为黑客可能通过暴力破解你的ROOT密码,这样大大的增加系统的危险性。那么Linux系统是如何设置禁止ROOT ssh远程登录的呢?下面看看Linux禁止ROOT从ssh远程登陆的具体操作。

1、修改sshd的配置文件/etc/ssh/sshd_config。

[root@Linux ~]# vi /etc/ssh/sshd_config # Authentication: #LoginGraceTime 2m #PermitRootLogin yes #默认为ROOT可以远程登录登陆 #StrictModes yes #MaxAuthTries 6 #MaxSessions 10 PermitRootLogin no #修要修改的部分 2、重启sshd服务,让修改后的sshd配置生效。 [root@Linux ~]# service sshd restart

注:

1、在sshd配置文件/etc/ssh/sshd_config中,很多配置项被#注释掉了,表示不做任何修改当前默认配置为这些配置。

2、通过普通用户登陆sshd以后可以通过su命令切换到ROOT用户。


Viewing all articles
Browse latest Browse all 11063

Trending Articles