home *** CD-ROM | disk | FTP | other *** search
- LOCK March 19, 1985
- ~~~~~~
-
- Lock is a simple Xenix/Unix shell script program that allows the user to
- lock up his or her terminal. It can also be used to keep snoops out of your
- personal files, or use it to lock up a program that you don't want others
- to use.
-
- It's strongest feature is that only the correct password will break
- the program loop, (or a complete system shutdown). No amount of key hitting
- will break it.
-
- Lock could even be put in /etc/rc to prevent unauthorized users from
- reactivating multiuser mode. I personally have not explored all the
- applications open to this type of program. I'm sure there are many more.
-
- This program should work well for all Xenix/Unix users since it is
- a straight forward shell program with no hidden goodies in it.
-
- For users of other systems it should be fairly simple to alter the
- commands to fit your systems requirements.
-
-
-
- Let's look at the program structure;
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
- : " Dave's Terminal Lock Program (revision 1.1) March 19, 1985 "
-
- echo
- echo ":Lock On:"
- echo
- while true
- do
- stty -echo
- if test wow = "$password"
- then echo ; echo ; echo ":Lock Off:" ; reset ; exit
- else echo ; trap "continue" 2
- echo -n "Password? "
- read password
- fi
- done
-
-
-
- Line by line Summary of commands;
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- (echo) Tells the interpreter to display the following data
- on the CRT, (echo) on a line by itself is the same as
- a carriage return.
-
- (while true) Is the start of a loop cycle.
-
- (do) Starts the loop.
-
- (stty -echo) Stops characters from being echoed back to the
- terminal, (characters that you type on your keyboard
- will not be displayed at your terminal).
-
- (if-then-else) Most processors have some sort of (if-then-else) clause.
-
- (test) Should be self explanatory.
-
- (reset) Is a terminal reset program, hopefully your system
- will have the equivalent of some such command.
-
- (exit) Obvious isnt it?
-
- (trap "continue" 2) Tells the program not to accept anything but the correct
- password. No amount of key hitting or "phreaking" will
- break the loop, only a correct password or a complete
- system shutdown.
- The "2" means start the program over again at line #2.
-
- (echo -n) Tells the interpreter to keep the cursor on this line.
-
- (read) Tells the interpreter to "read" what you typed at the
- keyboard upon reciept of the next carriage return.
-
- (fi) Closes the (if-then-else) statements.
-
- (done) Ends loop.
-
- The symbol (;) is a mnemonic for a new line.
- ($) sets up a variable.
-
-
- Notes;
- ~~~~~
- -When you first try this program some care should be used. Instead of
- using ; trap "continue" 2
- use ; echo "Nope, that's not it"
- When the program is executing properly then you can put in the correct
- statement.
-
- -After typing up the program and checking it out, for terminal locking
- change the permissions accordingly and put the program in your home
- directory or in /usr/bin. Don't forget to make the program executable!
-
- -To use the program for text file or program access, simply insert
- the text or program right after the "done" statement.
-
- -The password can be any word or combination of words and can be any
- combination of alpha or numeric data.
-
- Summary:
- ~~~~~~~
-
- As stated previously this little program can be used in a variety
- of applications. One of it's strongest features is the fact that
- ONLY the CORRECT password will break the program loop and reset
- the system back to normal status. This includes the rub-out key,
- the delete key, any and all control keys, etc.
-
- If you choose not to use the program itself so be it, but notice
- (if your familiar with Xenix/Unix) how to prevent users from
- interrupting a program execution, including using the delete key,
- by having the "read" command at the bottom of the script instead
- of at the top or middle of the program.
-
-
- he delete key,