您的位置主页 > 服务器专区 > unix > freebsd提供普通用户su权利,并关闭root用户远程登录

freebsd提供普通用户su权利,并关闭root用户远程登录

2010-01-06    文章来源:互联网    浏览次数:474
FreeBSD系统下默认是不允许root用户直接通过ssh连接到服务器的,在安装FreeBSD系统时要创建一个额外的用户,切忌一定要把这个用户加入到wheel组中(如果不加入到这个组中的话就无法ssh),也可以安装完系统后创建用户,并把这个用户加入wheel组。
1、给普通用户su - root的权力
pw groupmod wheel -m <username>
或:
pw user mod <username> -g wheel
或者直接修改/etc/group文件,把相应的用户加到wheel组就可以
wheel:*:0:root,username
 
2、禁止root远程登录 
编辑ssh配置文件:vi /etc/ssh/sshd_config
#PermitRootLogin no
改为:
PermitRootLogin no
重启ssh:/etc/rc.d/sshd restart

 
  • 上一篇: Failed to enable the ”httpready”
  • 下一篇:没有了
  • 文章评论(查看全部)

    验证码: 中评 好评 差评