Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 24 Oct 2014, 04:44
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
How to password protect a folder?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [8 Posts]  
Author Message
sidders

Joined: 23 Jul 2008
Posts: 470
Location: Bolton, uk

PostPosted: Mon 22 Jun 2009, 16:23    Post subject:  How to password protect a folder?  

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
Back to top
View user's profile Send private message 
trapster


Joined: 28 Nov 2005
Posts: 2009
Location: Maine, USA

PostPosted: Tue 23 Jun 2009, 06:50    Post subject:  

See Here for how I do it.
_________________
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Puppeee4.31 + 1.0, Puppy4.10 + Lupu52
Currently using Slacko AND lupu52 w/ fluxbox
Back to top
View user's profile Send private message Visit poster's website 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11121
Location: Arizona USA

PostPosted: Tue 23 Jun 2009, 09:29    Post subject:  

Be advised that password-protecting an unencrypted folder will not prevent accessing the folder from, say, a live CD. If all you want to do is prevent access by relatively unsophisticated users who may only have a casual interest in the contents of the folder, a password sounds sufficient.
Back to top
View user's profile Send private message 
sidders

Joined: 23 Jul 2008
Posts: 470
Location: Bolton, uk

PostPosted: Tue 23 Jun 2009, 10:25    Post subject:  

Quote:
prevent access by relatively unsophisticated users who may only have a casual interest in the contents of the folder, a password sounds sufficient.


Thats what i'm after, an extra check before soneone wipes their hdd. Just batting ideas about.

Thanks Trapster and Flash
Back to top
View user's profile Send private message 
muggins

Joined: 20 Jan 2006
Posts: 6688
Location: lisbon

PostPosted: Tue 23 Jun 2009, 20:02    Post subject:  

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
Back to top
View user's profile Send private message 
sidders

Joined: 23 Jul 2008
Posts: 470
Location: Bolton, uk

PostPosted: Thu 25 Jun 2009, 16:46    Post subject:  

Thanks Muggins. I decided to go for your suggestion, however i was buggered if i could work it out. Couldnt even get it to work without a password. I will come back to it at some point and work it out.

Confused
Back to top
View user's profile Send private message 
muggins

Joined: 20 Jan 2006
Posts: 6688
Location: lisbon

PostPosted: Thu 25 Jun 2009, 21:43    Post subject:  

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:

Code:
makeself --gzip --nox11 d1 archive_name "archive_name" ./run


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:

Code:
#!/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
Back to top
View user's profile Send private message 
sidders

Joined: 23 Jul 2008
Posts: 470
Location: Bolton, uk

PostPosted: Fri 26 Jun 2009, 07:07    Post subject:  

Brilliant Thx Muggins.

I did a simpler bash script for the password bit.

Code:
#!/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


For the makeself

Code:
# makeself.sh --gzip installer ./oneclick.run "oneclickinstaller" ./pwd


I just need to test it all out on a machine.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [8 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Beginners Help ( Start Here)
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0615s ][ Queries: 11 (0.0087s) ][ GZIP on ]