Password protect a folder

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
oliver14
Level 1
Level 1
Posts: 2
Joined: Mon Jun 13, 2011 10:41 pm

Password protect a folder

Post by oliver14 » Thu Jul 19, 2012 2:37 pm

Hi guys

I came over to Mint because Ubuntu was giving me frustrations at every release, anyway, can some one "password protect a folder" in Mint...?

Thanks guys
The question is more important that the answer.

User avatar
xenopeek
Level 24
Level 24
Posts: 23493
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Password protect a folder

Post by xenopeek » Thu Jul 19, 2012 4:49 pm

You can password protect a folder; there are various ways you can do that (Google "linux password protect directory"). Depends on whom you are hiding the folder contents from how far you should go with this. If you are the only administrator on the machine, and each user has their own account, you could also just make your folder inaccessible to others. This is a weak protection, as any nerdy kid with physical access to your machine can become root from GRUB and then see those files. So it depends on your kids (if any), and what kind of files you want to protect, whether this suffices or not.

Let's say you have a folder called "mine", you can either with from the right-click > Properties > Permissions menu in the file manager remove all access for the group and others (only leave owner), or you can open a terminal and run:

Code: Select all

chmod g=,o= mine
to remove all the access for the group and others from the folder "mine". Note for this to work, you should be the owner of the folder (the default if it is in your home folder).
Image

oliver14
Level 1
Level 1
Posts: 2
Joined: Mon Jun 13, 2011 10:41 pm

Re: Password protect a folder

Post by oliver14 » Thu Jul 19, 2012 8:20 pm

Thank you very much for your reply...Appreciate it.
The question is more important that the answer.

mintybits
Level 6
Level 6
Posts: 1123
Joined: Fri Jan 27, 2012 5:09 pm

Re: Password protect a folder

Post by mintybits » Thu Jul 19, 2012 8:30 pm

Or make an encrypted folder.
I have never used this but it looks easy enough: http://www.faqforge.com/linux/encrypt-f ... ntu-linux/

Noo 2 Linuxmint
Level 1
Level 1
Posts: 1
Joined: Sun Dec 07, 2014 7:23 pm
Location: Planet Earth

Re: Password protect a folder

Post by Noo 2 Linuxmint » Wed Dec 10, 2014 5:57 pm

"Let's say you have a folder called "mine", you can either with from the right-click > Properties > Permissions menu in the file manager remove all access for the group and others (only leave owner),"

This would still leave access to any such "protected" folder if you leave your machine whilst logged in (to get a cup of coffee). I believe a better solution to be the use of the "compress" utility in the folder context menu:

1. Using your mouse place pointer over folder to be password protected and right click.

2. Choose "compress" from the context menu which appears.

3. Using file extension .7z type in your password under "other options" ensuring "Encrypt file list too" is checked.

4. Click "create" and your done - a compressed folder file appears, which upon attempting to open it, requires you to provide the password you created.

This way you can close the folder your'e working in whilst leaving yourself logged in to your machine, leave your machine going for that coffee and the folder cannot be accessed by any one passing by your machine whilst it's unattended, unless you left the password hanging around on a bit of paper......

bad medicine
Level 4
Level 4
Posts: 209
Joined: Mon Mar 28, 2016 9:13 am

Re: Password protect a folder

Post by bad medicine » Tue Feb 12, 2019 12:30 pm

Noo 2 Linuxmint wrote:
Wed Dec 10, 2014 5:57 pm
"Let's say you have a folder called "mine", you can either with from the right-click > Properties > Permissions menu in the file manager remove all access for the group and others (only leave owner),"

This would still leave access to any such "protected" folder if you leave your machine whilst logged in (to get a cup of coffee). I believe a better solution to be the use of the "compress" utility in the folder context menu:

1. Using your mouse place pointer over folder to be password protected and right click.

2. Choose "compress" from the context menu which appears.

3. Using file extension .7z type in your password under "other options" ensuring "Encrypt file list too" is checked.

4. Click "create" and your done - a compressed folder file appears, which upon attempting to open it, requires you to provide the password you created.

This way you can close the folder your'e working in whilst leaving yourself logged in to your machine, leave your machine going for that coffee and the folder cannot be accessed by any one passing by your machine whilst it's unattended, unless you left the password hanging around on a bit of paper......

As others may have discovered the hard way, this doesn't actually protect the original folder. Even if you keep the same folder name, it will just create a password protected folder with the same name, with the .7z extension.

The newly created folder is protected but the original folder is still there, unchanged and unprotected.
Thinkpad T410 i5 2.4 Ghz 4GB
Dual boot Mint Cinnamon 17.3 64-bit, Windows 7
kernel 3.13.0-37-generic x86_64 (64 bit)

User avatar
AndyMH
Level 6
Level 6
Posts: 1243
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Password protect a folder

Post by AndyMH » Tue Feb 12, 2019 1:46 pm

Have a look at EncFS, it has its limitations but easy to use
Homebrew i5-8400+GTX1080 Cinnamon 19.0, Thinkpad T430 i7-3632 Cinnamon 19.0, Thinkpad T420 Cinnamon 18.3, Thinkpad T410 Cinnamon 17.3, Thinkpad T60 19.0 Mate

redlined
Level 5
Level 5
Posts: 947
Joined: Wed Jun 06, 2018 8:12 pm
Location: Mile High, Green State! (Denver, CO;)

Re: Password protect a folder

Post by redlined » Tue Feb 12, 2019 2:19 pm

using favorite search engine look for "encrypted container linux" or similar. cryptsetup/dm-crypt may be a bit complicated, but is native supported, method (perhaps a bit simpler is this link, ignoring the move to cloud portion if not applicable).

simple and secure method would be use VeraCrypt (based on the old truecrypt) its a well regarded 3rd party app for such uses. (what I use)

and Cryptomator may simplify things if you want to storage your stuff on local network or some cloud. (I had issues as a noob trying to get this one working nicely)

edit to add: just noticed OP thread date and why/how it came back up as active, leaving comment for posterity sake :lol:
LM19.1 Cinnamon 4.0.9, kernel 4.18.0-15 x86_64
HP15 Laptop: 2Ghz Celeron quad core, 1TB 860 Evo SSD, 8GB Timetec RAM

My go to sites, besides this forum:
(start here! - EasyLinuxTips project then go Learn Linux-fu!

Post Reply

Return to “Newbie Questions”