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?
encrypt / decrypt a folder by ecryptfs for special user only
444 Views Asked by amir hajizadeh At
2
There are 2 best solutions below
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;
}
No, this is not possible because access permissions suffice as stated explicitly in the ecryptfs FAQ.