大家好,好久沒(méi)來(lái)了,SORRY,單位很忙,總下鄉(xiāng)很少回家 。在下鄉(xiāng)閑時(shí),看了一個(gè)保衛(wèi)的文件,針對(duì)關(guān)于佳木斯盜支存款的手段,編了一個(gè)限制非營(yíng)業(yè)時(shí)間登錄的程序并有注冊(cè)記錄,程序比較簡(jiǎn)單,但也能起到一定的計(jì)算機(jī)作案的防范作用,大家如果覺得有用就試一試,在業(yè)務(wù)程序用戶newbank的.profile頭加入如下語(yǔ)句 。
trap " " 1 2 3 5 15
clear
wkltime=`date%H%M`
wklym=`date%m`
if [ $wklym -ge 5 -a $wklym -lt 10 ]
then
if [ $wkltime -gt 730 -a $wkltime -lt 1730 ]
then
echo ""
else
checkmm
if [ $? -eq 8 ]
then
echo `date` >>loginerror
exit 0
fi
fi
else
if [ $wkltime -gt 730 -a $wkltime -lt 1630 ]
then
echo ""
else
checkmm
if [ $? -eq 8 ]
then
echo `date` >>loginerror
exit 0
fi
fi
fi
echo `date` >>loginok
以上是分5月1日與10月1日之間 7:30 ---17:30和在此之外時(shí)間7:30----16:30[營(yíng)業(yè)時(shí)間,大家可以跟據(jù)實(shí)際情況改動(dòng) ]判斷是否在營(yíng)業(yè)時(shí)間內(nèi),如果不再,調(diào)用密碼程序(這是個(gè)側(cè)門程序,原因是如果網(wǎng)點(diǎn)必須在營(yíng)業(yè)外時(shí)間必須要做一些工作的話,可由系統(tǒng)管理電話告訴運(yùn)行密碼,輸入后就可以在非營(yíng)業(yè)時(shí)間進(jìn)入程序,這個(gè)密碼是由時(shí)間和所號(hào)生成的,只能在這個(gè)所和這一天才能進(jìn)入,過(guò)一天或換一個(gè)所都不能進(jìn)入)密碼程序源程序如下是ESQL/C編的,也可以用shell編,但容易留明碼,編譯方法esql -o checkmm checkmm.ec
源程序:
#include
#include
#include
$include sqlca;
wkl_mm(p)
short p;
{
short mdy_array[3],mm,dd,yy,ww;
$long cxsh;
int i,ookk;
long sysdate,lcxsh;
rtoday(&sysdate);
$database bankstar;
$select sh[4,7] into $cxsh from cxs ;
printf("cxsh=%d",cxsh);
rjulmdy(sysdate,mdy_array);
ww=rdayofweek(sysdate);
mm=mdy_array[0];
dd=mdy_array[1];
yy=mdy_array[2];
ookk=cxsh yy-10*(dd%p)-(mm*110*p) dd*p ww*p-((ww*7)%p);
return(ookk);
}【中創(chuàng)信合的一個(gè)小程序,或許有用】main()
{
long passw,passw1;
signal(SIGINT,SIG_IGN);
signal(SIGQUIT,SIG_IGN);
printf("警告!!!!n");
printf("已經(jīng)超出營(yíng)業(yè)時(shí)間,還要進(jìn)入系統(tǒng)做什么?程序中有注冊(cè)記錄,不要以身試法n");
printf("如果真是工作需要,請(qǐng)輸入電腦科給的授權(quán)密碼:");
scanf("%d",&passw);
passw1=wkl_mm(10);
printf("input:%d",passw1);
if(passw1 == passw)
return 0;
else
return 8;
}另外,一時(shí)倉(cāng)促,密碼生成的算法比較簡(jiǎn)單,哪位高手能改寫一下,有沒(méi)有好的算法?
你這個(gè)程序做得不太好,只針對(duì)此用戶,若別人知道其它的用戶甚至root用戶的口令
你這程序啟不失效了 我這里做了一個(gè)小程序是針對(duì)所有用戶的登錄時(shí)間做限制,大家
可以試一試
由兩個(gè)文件組成profile和loginfo
******profile文件內(nèi)容 ,注意:先將/etc/profile做好備份,然后再將此文件拷入#!/bin/sh
# The following was generated from
# NLS/en/adm.gen
#
MF_ADM=adm.cat@Unix
#
MS_PROFILE=1
MSG_MAIL=1
:
#@(#) profile.sh 26.1 95/07/25
#
#Copyright (C) 1988-1995 The Santa Cruz Operation, Inc.
#All Rights Reserved.
#The information in this file is provided for the exclusive use of
#the licensees of The Santa Cruz Operation, Inc. Such users have the
#right to use, modify, and incorporate this code into other products
#for purposes authorized by the license agreement provided they include
#this notice and the associated copyright notice with any such product.
#The information in this file is provided "AS IS" without warranty.
##ident"@(#)adm:profile1.10"
trap "" 1 2 3
umask 022case "$0" in
-sh | -rsh | -ksh | -rksh)# if not doing a hushlogin, issue message of the day, if the file is out there
[ "X$HUSHLOGIN" != "XTRUE" ] && [ -s /etc/motd ] && {
推薦閱讀
- 房屋租賃協(xié)議書如何寫
- 微信音樂(lè)怎么下載
- 怎么找回微信聊天記錄
- 辭職報(bào)告怎么寫范文
- 雙鍵合璧,掌握天下——東信ES1009
- 水產(chǎn)養(yǎng)殖病害的綜合防治技術(shù)
- 魔酸與氫氧化銫混合會(huì)發(fā)生什么
- 什么叫鐵碳合金相圖
- 配合飼料的使用與魚病的發(fā)生
- 微信運(yùn)動(dòng)98800步怎么刷
