simple boot password

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

simple boot password

#1 Post by jpeps »

Prompts for password at bootup. Put script name on first line of /etc/profile.local, and script in PATH. Edit "mypassword"

Code: Select all

#!/bin/sh

### Prompts for Password; loops until correct
###  Runs once, during startup. Run from /etc/profile.local 

PASS="mypassword"

[ -f /tmp/passlock ] && exit

while [ ! "$x" = "$PASS" ]; do
 echo "password:" 
stty -echo     # hide typing
 read ans  
 x="$ans"  
stty echo   # turn back on 
done

touch /tmp/passlock 

Post Reply