📄 keyaudit.sh
字号:
#!/bin/ksh# this script will look thru the skeykeys file for# people with sequence numbers less then LOWLIMIT=12# and send them e-mail remindes to use keyinit soonLOWLIMIT=12if [ "$1" != "" ]then LOWLIMIT=$1fi# a copy of notices will go to ADMINADMIN=jswSUBJECT="Reminder: Run keyinit"HOST=`/usr/bin/hostname`# an skeykeys entry looks like# jsw 0076 la13079 ba20a75528de9d3a# the sequence number is the second entry#for i in `/usr/bin/awk '{print $1}' /etc/skeykeys`doSEQ=`/usr/bin/grep "^$i[ ]" /etc/skeykeys|/usr/bin/awk '{print $2}'`if [ $SEQ -lt $LOWLIMIT ]then KEY=`/usr/bin/grep "^$i[ ]" /etc/skeykeys|/usr/bin/awk '{print $3}'` if [ $SEQ -lt 3 ] then SUBJECT="IMPORTANT action required" ADMIN=admin fi ( print "~c jsw" print "You are nearing the end of your current S/Key sequence for account $i" print "on system $HOST." print "Your S/key sequence number is now $SEQ. When it reaches zero you" print "will no longer be able to use S/Key to login to the system. " print "If you are now logged in via S/Key, use the command " print " keyinit -s " print "on system $HOST to reinitialize your sequence number." print "Be sure you use a different key from the current one which is" print " $KEY" print "You can continue to use the same secret password." print " " print "If you are logged in from work (via the secure Bellcore network)," print "you may use the command" print " keyinit" print "on system $HOST. The keyinit program will automatically generate" print "a new key for you." print "Thank You." print " Your S/Key System Administrators" ) | /usr/ucb/mail -s "$SUBJECT" $i $ADMINfidone
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -