Find the answer to your Linux question:
Results 1 to 8 of 8
I need to password-protect my directories, because I don't want my boss to see everything I save or download. He obviously knows the 'root' password and I'm not that familiar ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2004
    Posts
    1

    How can I protect a folder with a password?


    I need to password-protect my directories, because I don't want my boss to see everything I save or download. He obviously knows the 'root' password and I'm not that familiar with Linux, so I don't know how to "hide" some of my directories from him.
    Thanks!

  2. #2
    Linux Enthusiast scientica's Avatar
    Join Date
    Sep 2003
    Location
    South- or "Mid-" Sweden
    Posts
    742
    Really you can't hide anything from root... but you could compress your folder with some format that supports encryption.
    But why would you want to do that unless you do something you're not supposed to do at work?
    Regards Scienitca (registered user #335819 - http://counter.li.org )
    --
    A master is nothing more than a student who knows something of which he can teach to other students.

  3. #3
    Linux Enthusiast
    Join Date
    Jun 2004
    Location
    Windsor, CO
    Posts
    656
    Encrypt them instead. root has access to everything, but if you actually encrypt the files instead, you're boss would have to be very smart indeed to access them. Although you'll be inviting his suspicion either way...
    Emotions are the key to the soul.
    Registered Linux User #375050

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer
    Join Date
    May 2003
    Location
    Greece / Athens
    Posts
    1,169
    take a look at the banner below!!
    Linux For Ever!

  6. #5
    Linux Guru
    Join Date
    May 2004
    Location
    forums.gentoo.org
    Posts
    1,817
    Wow, stathisx, it's like the whole web knows what we're talking about :o
    /IMHO
    //got nothin'
    ///this use to look better

  7. #6
    Linux Engineer
    Join Date
    May 2003
    Location
    Greece / Athens
    Posts
    1,169
    does it matter??we don't talk about my pc!
    Linux For Ever!

  8. #7
    Just Joined!
    Join Date
    Jan 2005
    Posts
    4
    Code:
    gpg --gen-key
    
    tar vc dir_to_encrypt | gpg -e -r you -o backup.tar.gpg
    wipe -rf dir_to_encrypt
    
    gpg -d backup.tar.gpg -o -|tar vx
    
    wipe ~/.bash_history

  9. #8
    Just Joined!
    Join Date
    May 2006
    Posts
    11
    I've been interested in adding passwords to files and directories myself,and that is what brought me to this thread.

    I tried this after reading this thread,and it seems to work.
    Give this a shot and see what you come up with.

    Create a directory on your desktop for this experiment,and name it test.
    Copy a few files and paste them into this directory so it isn't empty
    Now open a terminal and enter:

    cd Desktop <enter>
    zip -e -r test test <enter>
    enter a password <enter>
    confirm password <enter>

    You now have a zip file named test.zip with a password needed to open it.
    It is still on your desktop,leave it there to finish this experiment.

    Now su to root.
    Enter ls /home/username/Desktop/test.zip
    The result should be /home/username/Desktop/test.zip
    That didn't say much about its contents.

    Now enter cat /home/username/Desktop/test.zip
    That should result in something like this:
    Code:
    PK
            8SO8
    
    test/UT    GuGUx~`1PK
                                           PK      45O8_(test/(here it would list the contents of files but will not open the files themselves) passwordUT       szGWGUxʰ_iHѽg"63(U?Q]zhRz4
                                                       mp|+V^P8z|JN>yl9%'!R<x3▒y+Nw!e
                                     0   5vV2P_(PK
            8SO8
    Now copy the password protected zip file to a new temporary directory.
    Su to root in that directory,and enter this command
    unzip -a <enter>
    It will ask root for YOUR password.

    Now log in as root.
    Go to /home/username/Desktop/test.zip and open it.
    All the files will be listed,but there should be an error when trying to open the files.
    Now,still as root,try to open it with ark.
    It will still ask root for the password.

    Try the command unzip -a test.zip again.
    C'mon Mr.Root.What's the password?

    There probally is a way for root to actually open the password protected files,and I'd like to hear about it if there is.
    And I don't mean for root to use a password cracker to do it!!!!
    What I've mentioned so far,even root can't read the files without YOUR password.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •