0

can i encrypt a folder and decrypt it only for special user by encrypts tools in Linux? in this case other users can not view files in decrypted folder. a way is using permissions to access folder but has another way?

2 Answers2

0

No, this is not possible because access permissions suffice as stated explicitly in the ecryptfs FAQ.

David Foerster
  • 1,461
  • 1
  • 14
  • 23
0

You might also try this mounting option - ecryptfs_check_dev_ruid, it forces ownership check on mounted directory. From main.c:

if (check_ruid && !uid_eq(path.dentry->d_inode->i_uid, current_uid())) {
    rc = -EPERM;
    printk(KERN_ERR "Mount of device (uid: %d) not owned by "
           "requested user (uid: %d)\n",
        i_uid_read(path.dentry->d_inode),
        from_kuid(&init_user_ns, current_uid()));
    goto out_free;
}
andreym
  • 41
  • 3