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 Thu 30 Oct 2014, 15:12
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 Posts_count  
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: 2012
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_website 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11125
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: 6689
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: 6689
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:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Beginners Help ( Start Here)
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0588s ][ Queries: 12 (0.0034s) ][ GZIP on ]