Chinaunix首页 | 论坛 | 博客
  • 博客访问: 482823
  • 博文数量: 127
  • 博客积分: 7010
  • 博客等级: 少将
  • 技术积分: 1972
  • 用 户 组: 普通用户
  • 注册时间: 2006-12-01 12:42
文章分类

全部博文(127)

文章存档

2009年(33)

2008年(94)

我的朋友

分类: LINUX

2008-07-24 10:56:27

一./etc/ttys  限制终端登陆
ttyv1   "/usr/libexec/getty Pc"         cons25  on  secure
ttyv2   "/usr/libexec/getty Pc"         cons25  on  secure
ttyv3   "/usr/libexec/getty Pc"         cons25  on  secure
ttyv4   "/usr/libexec/getty Pc"         cons25  on  secure
ttyv5   "/usr/libexec/getty Pc"         cons25  on  secure
ttyv6   "/usr/libexec/getty Pc"         cons25  on  secure
ttyv7   "/usr/libexec/getty Pc"         cons25  on  secure
ttyv8   "/usr/X11R6/bin/xdm -nodaemon"  xterm   off secure

1)上面on说明该终端允许登陆,默认情况下是8个终端是允许登陆的,可以用ALT-FX[1-8]进行切换,如果需要禁止,只需将on改成off
2)secure 表明系统在物理上安全的,允许ROOT帐户进行登陆,如果不允许,只需将secure 改成insecure或直接删除


二./etc/ssh/sshd_config
  可以设定允许个别组或用户访问
  例:1) echo "AllowGroups remote">>/etc/ssh/sshd_config  允许remote这个组的用户远程登陆
     2) echo "AllowUsers a b c ">>/etc/ssh/sshd_config  允许ABC  三个用户访问
 
   更严格一点可以用 
         AllowUsers a@192.168.0.1 b@192.168.0.2 c@192.168.0.3

修改配置文件后记得要重启下服务


三./etc/login.conf   限制登陆时间
  这个文件支持times.allow 和times.deny选项.例如,要限制用户在周一到周五的早上9点到下午5点之间登陆,可以把下面这行的内容添加到:\[字段:
:times.allow=Mo-Fr0900-1700:\

一旦引用了times.allow,不属于规定时间段的访问就会自动被禁止

修改/etc/login.conf后,都要记得用"cap_mkdb /etc/login.conf"命令重建数据库,并对所做的修改进行测试
 
阅读(752) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~