How to Create a disk partition in the RHEL6.0 Encrypted File System

Source: Internet
Author: User
Linux implements the encrypted file system. luks is the encryption standard for Linux hard disks. Mainly used: luksFormat, luksOpen, luksClose, luksAddKey and other parameters and manual creation of/etc/crypttab first we create a disk partition/dev/sdb5 without formatting households 1. Encrypted partitioning # cryptsetupluksFormat/dev/sdb5AreyousureTyp

Linux implements the encrypted file system. luks is the encryption standard for Linux hard disks.

You can use luksFormat, luksOpen, luksClose, luksAddKey, and other parameters to manually create/etc/crypttab.

First, create a disk partition/dev/sdb5 without formatting.

1. Encrypted partitioning

# Cryptsetup luksFormat/dev/sdb5

Are you sure Type Uppercase yes: YES

Enter luks passphrase: 123

Verify passphase: 123

2. decrypt the partition

Cryptsetup luksOpen/dev/sdb5 secret (mapped to secret)

Enter passphrase for/dev/sdb5:

3. Create a mount point

# Mkdir/mnt/test/secret

4. Format

Mke2fs-t ext4/dev/mappper/secret

5. hanging in a partition

# Mount/dev/mapper/mnt/testsecret

6. Detach a partition

# Umount/dev/mapper/secret

# Cryptsetup luksClose secret

7. Automatic Configuration mounting

Add the following lines to. etc/fstab:

/Dev/mapper/secret/mnt/testsecret ext4 defaults 0 0

Create a/etc/crypttab File

Add

Secret/dev/sdb5/root/testpasswd

Create Password File

Echo "123">/root/testpasswd

Chmod 600/root/testpasswd

Add a key file

# Cryptsetup luksAddKey/dev/sdb5/root/testpasswd

The host is successfully restarted.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.