Now we are going to setup an encrypted file system for a user private use, and this encrypted file system is "under the home directory of this user. We can use another file system structure to be stand of the encrypted in user's home directory, like "/ crypt / users", which contains both the encryption container each & the user's encrypted file system. The followings are commands to show you how to create encryption container annually, for that you will have to define the path and the parameters encryption, and we give a name to the file which will be the container of the encrypted file system.
Code:
// Choose one From The available loop devices, and Number is Between 0 and 7
LOOP # = / dev/loop0
// Location of the Point The mount point encryption
MOUNTPOINT # = $ HOME / crypt
// The Name Of The encrypted file Which Contains the encrypted file system
# Container = $ MOUNTPOINT /.crypt.img
// Define the encryption algorithm, here we use AES
CYPHER # = aes
// Set The offset
# Read Sector
OFFSET = # $ (*Sector $ 512)
// Get the Size of the container (Mb)
# Read SIZE
The Creation Of The Container Encryption:
Code:
// Just remember not to use the Directory / dev / zero For the encryption container
# Mkdir-p $ MOUNTPOINT
# Dd if = / dev / urandom of = $ bs = 2M CONTAINER count = $ SIZE
# Chmod 600 $ container
Turn o the encryption system, at this step, the System will ask you to choose a password encrypted file system.
Code:
// Add The modules into memory, The system running kernel
# Modprobe loop
# Modprobe Cryptoloop
# Modprobe aes
// The force of Cryptoloop daemon, and Give the password
# / Usr / loca / sbin / losetup-e-CYPHER $ $ o $ OFFSET $ LOOP CONTAINER
// If you want to Get the configuration information about the loop devices, you can do it like this:
# / Usr / local / sbin / losetup $ LOOP
Lastly initialization of the encryption.
Bookmarks