![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Microsoft Security Advisory (917021): Description of the Wi-Fi Protected Access 2 sup | iBot | Security Advisories (RSS) - Microsoft | 0 | 12-24-2007 07:00 AM |
| Print on a printer which is password protected | Anuj | UNIX for Dummies Questions & Answers | 1 | 07-06-2005 10:44 AM |
| Multiple protected directories | ericg | UNIX for Dummies Questions & Answers | 2 | 06-10-2002 07:58 PM |
| Creating a Password-Protected directory for ftp Uploads & Downloads | NAL | Security | 3 | 06-03-2002 02:20 PM |
| I inhereted a Unix server that is password protected...Help! | fxsaint | UNIX for Dummies Questions & Answers | 1 | 10-26-2000 05:12 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to make script password protected
Hi All,
I want to make my script password protected. i e: if somebody runs my script it should prompt for password. Can somebody help me in to execute the same?? Thanks in Advance |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
hi,
I got a very simple idea. Write something like this in the beginning of your script for the password checking. ... ACTUAL="perftest" read -s -p "Password: " enteredpass echo "" [ "$enteredpass" != "$ACTUAL" ] && echo "Sorry" && echo "exiting" || echo "Conti.." ... Since you will be storing your password in your script itself, you have to protect your shell script by using shc. Generic shell script compiler(shc) creates a stripped binary executable version of the script specified with -f on the command line. (shc encrypts shell scripts using RC4) Hope this helps. //Jadu |
|
#3
|
|||
|
|||
|
I am not very clear about shc,
Can you tell me how to make a sciprt as shc?? |
|
#4
|
||||
|
||||
|
#5
|
|||
|
|||
|
how to Encrypt bash scripts?
Hi,
I tried encryting a bash script, and I received the below error... -bash: shc: command not found Is there a different command to execute bash scripts?? |
|
#6
|
||||
|
||||
|
reasonably simple password encrypter process:
you could use perl to crypt a password e.g.: perl -e "print crypt('password','AA');'\n'" then use perl in your script to check the password e.g.: /usr/bin/perl -e "print 'match' if crypt('password','AA') eq 'AA6tQYSfGxd/A';" and do the test / exit or continue with script piece but as noted already this does not hide the contents of the script - for very basic security it'll do though... |
|
#7
|
||||
|
||||
|
Quote:
and follow my blog link. |
||||
| Google The UNIX and Linux Forums |