Linux – How to password protect a directory in linux? without zipping, changing file permission or encrypting

encfslinuxpasswordpermissions

I'm a user on a public Linux server. We have a public shared folder which all users can use. I want to create a folder that I only want a few users to access. This can be done in the following ways:

  1. Create a group of users you want to provide access and then change the folder permission to that group. I can't do this because I don't have root privileges. Even if I ask the admin to create a group for me, I'll have to occasionally add/remove users from the group. This is not feasible
  2. Encrypt and zip the folder using "zip re" command. This will zip the folder and every time a user needs to access the contents, he needs to unzip. This becomes infeasible when my folder grow up to be large.
  3. creating and mounting an encrypted directory with encfs. Here you have to maintain two folders – an encrypted folder and a mount point folder. Every time you need to access a file/folder, you need to mount it to the mount point. This again requires a lot of copying a moving and is inefficient.

What I'm looking for is a simple process: enter the password and you can view the contents of the folder; enter the wrong password and access is denied. All I have to do is to share this password with other users. Is there anything in Linux that does this?

Best Answer

Of all the methods mentioned, the best way is to create a group and provide read/write access to the group. And then add or remove from the group.

Related Question