Is there any way to password protect a folder?.
Or will i have to use an encryption tool. Its to protect the oneclick script, by making it available, with guide, so no one can go gung ho and wipe their HDD. Maybe create an admin folder.
Ta in advance
How to password protect a folder?
See Here for how I do it.
trapster
Maine, USA
Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog
Maine, USA
Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog
sidders,
another possibility is to use makeself to create a self-extracting archive of the directory. Because makeself uses a script, or executable, within the target directory, you can then create a target script that won't run, unless some particular password is entered. If the proper password is entered, the script can then run the one-click script.
http://megastep.org/makeself
another possibility is to use makeself to create a self-extracting archive of the directory. Because makeself uses a script, or executable, within the target directory, you can then create a target script that won't run, unless some particular password is entered. If the proper password is entered, the script can then run the one-click script.
http://megastep.org/makeself
Hi Sidders,
say your target directory was called d1, and it contained a script called, for simplicity, run, then you could use makeself to create a self-extracting archive of this script like this:
This would create an archive, which would be extracted to /tmp directory, by executing ./archive_name, and then execute the script run.
You can replace "archive_name" with whatever, and save it to /usr/bin.
For run to test for a password, you could have something like this:
say your target directory was called d1, and it contained a script called, for simplicity, run, then you could use makeself to create a self-extracting archive of this script like this:
Code: Select all
makeself --gzip --nox11 d1 archive_name "archive_name" ./run
You can replace "archive_name" with whatever, and save it to /usr/bin.
For run to test for a password, you could have something like this:
Code: Select all
#!/bin/sh
params=$#
if [ "$params" -eq 1 ];then
echo && echo
params=$1
if [ "$params" == "qWerty" ];then #read the password
./actual_target_program #here run the real program
else
exit 1 #else exits
fi
else
#echo "wrong number of arguments!"
exit 1
fi
Brilliant Thx Muggins.
I did a simpler bash script for the password bit.
For the makeself
I just need to test it all out on a machine.
I did a simpler bash script for the password bit.
Code: Select all
#!/bin/sh
PASS="Wipehdd"
read -s -p "Password: " ans
echo
if [ "$PASS" == "$ans" ]; then
./pinstall.sh
else
echo "Wrong password, Installation stopped. close this window or try again"
fi
Code: Select all
# makeself.sh --gzip installer ./oneclick.run "oneclickinstaller" ./pwd