文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>怎么样做到限时登录?

怎么样做到限时登录?

时间:2005-08-30  来源:zdl333

自己写三个shell程序,调用at和系统维护功能

1、在指定的时间执行该shell,在/etc下生成一名为nologin的文件,如:

vi /sbin/login.denied

echo " Login Denied " > /etc/nologin

chmod 700 login.denied

2. 在指定的时间执行该shell,删除/etc/下的nologin文件,如:

vi /sbin/login.allowed

if [ -f /etc/nologin ]; then

rm /etc/nologin

fi

chmod 700 login.allowed

3. 编写一个限制时间的shell,如:

vi /sbin/security

if [ -f /sbin/login.denied ]; then

at -f /sbin/login.denid 22:00

fi

if [ -f /sbin/login.allowed ]; then

at -f /sbin/login.allowed 8:00

if

此种设置的功能是:从晚上10:00到第二天早上8:00静止非root拥护登录,显示为

系统维护状态。

另外,还需对root用户的登路终端进行限制,最好设置在console. 在RedHat 5.0下

在 /etc/security/access.conf中配置:

-:root:ALL EXCEPT console就可以了。
相关阅读 更多 +
排行榜 更多 +
谁是枪王小游戏

谁是枪王小游戏

飞行射击 下载
枪手求生之路官方版

枪手求生之路官方版

飞行射击 下载
代号秘境游戏

代号秘境游戏

棋牌卡牌 下载