当前位置:Linux教程 - 网络安全 - 网络安全 - ssh2不让root和其他用户登陆

网络安全 - ssh2不让root和其他用户登陆

ssh2不让root和其他用户登陆
2004-04-23 15:18 pm
来自:Linux文档
现载:Www.8s8s.coM
地址:无名

平台:redhat linux 7.3
版本:openssh-3.1p1-14
不希望root能够通过ssh2从远程登录,即使是在内网,在hosts.allow允许的情况下。
默认的/etc/securetty中已经禁止了所有的tty,但是root还是可以从远程直接登陆,
不知道大家如何解决这个问题?

/etc/ssh/sshd_config
PermitRootLogin no

在/etc/ssh/sshd_config文件中加上
DenyUsers:username
可以不让一般用户登陆