Setting Up eCryptFS in Linux
How to set up eCryptFS in Linux will be introduced in this post. We can store encrypted files in one eCryptFS directory. The content can be seen only after it is mounted as eCryptFS file system. Otherwise, the users can only see garbled characters in the files.
Install eCryptFS tools
# yum install ecryptfs-utils gettext
Add ecryptfs module to Linux Kernel
# modprobe ecryptfs
Add user to ecrypfs group
If we want to add user zma and eric to ecryptfs group:# vim /etc/groupFind:
ecryptfs:x:496:Then change it to:
ecryptfs:x:496:zma,eric
Mount ecryptfs
If we store encrypted file in /home/private directory:# mount -t ecryptfs /home/private /home/privateThen you can read/write from/to files under /home/private as a normal directory.
Umount ecryptfs
# umount /home/privateThen try to open a file under /home/private. Haha, nothing can be found!
When you want to read your find, mount this directory again and your files will be back :)
By: Zhiqiang Ma
Last updated: Nov 27, 2012
Views: 603
Tags: Client config, Fedora, FS, Server config, Tutorial
Tags: Client config, Fedora, FS, Server config, Tutorial