This post was published long ago, when I was a student and an amateur blogger. The links might be outdated and content may not be useful anymore. Please read this content keeping its age in mind.
Subject : System Software Laboratory
Branch : Information Science & Engineering
Semester : 6
University : VTU
[Click Here to get other programs by email ]
………………………………………………………………………………………………………………………….
PART -B
………………………………………………………………………………………………………………………….
- a) Shell script to implement terminal locking. It should prompt the user for a password. After accepting the password entered by the user, it must prompt again for password confirmation (to retype the password). If a match occurs, it must lock the terminal and promp for the password. If the proper password is entered, the terminal must be unlocked. Note the script must be written to disregard BREAK, Control-D etc. No time limit need be implemented for the lock duration.
stty -echo
echo “Enter the password: ”
read pw
echo “Confirm password: ”
read cpw
if[“$pw” = “$cpw”]
then
trap “.” 1 2 15 18 30
echo “Keyboard locked”
fi
echo “Enter password to resume
read npw
while[“$pw” = “$npw”]
do
echo “Enter password”
read npw
done
echo “Terminal unlock”
fi
stty sane
Leave a ReplyCancel reply