Find the answer to your Linux question:
Results 1 to 8 of 8
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #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.

  2. #2
    Linux Enthusiast scientica's Avatar
    Join Date
    Sep 2003
    South- or "Mid-" Sweden
    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 - )
    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
    Windsor, CO
    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
  5. #4
    Linux Engineer
    Join Date
    May 2003
    Greece / Athens
    take a look at the banner below!!
    Linux For Ever!

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

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

  8. #7
    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
    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 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/
    The result should be /home/username/Desktop/
    That didn't say much about its contents.

    Now enter cat /home/username/Desktop/
    That should result in something like this:
    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
                                     0   5vV2P_(PK
    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/ 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 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