• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

cryptsetup Command Examples in Linux

by Deepika

The cryptsetup command is a utility in Linux that is used to create and manage encrypted block devices. It allows you to set up encrypted disks, partitions, and other types of block devices, and provides tools for managing and accessing these devices.

To use the cryptsetup command, you will need to specify the name of the block device that you want to create or manage, as well as various options and arguments that control the behavior of the command.

For example, to create an encrypted block device:

# cryptsetup luksFormat DEVICE

This will create a new encrypted block device on the specified DEVICE. You will be prompted to enter a password, which will be used to encrypt and decrypt the device.

cryptsetup Command Examples

1. Initialize a LUKS volume (overwrites all data on the partition):

# cryptsetup luksFormat /dev/sda1

2. Open a LUKS volume and create a decrypted mapping at `/dev/mapper/{{target}}`:

# cryptsetup luksOpen /dev/sda1 target

3. Remove an existing mapping:

# cryptsetup luksClose target

4. Change the LUKS volume’s passphrase:

# cryptsetup luksChangeKey /dev/sda1

Filed Under: Linux

Some more articles you might also be interested in …

  1. Xen Hypervisor (xm) command Cheat Sheet
  2. How to audit all Commands run on OEL 5,6 using auditd
  3. CentOS / RHEL : iptables troubleshooting guide
  4. mknod Command Examples in Linux
  5. Difference Between Qemu and KVM
  6. pacman –deptest Command Examples
  7. Sample /etc/services file in Linux
  8. journalctl Command Examples in Linux
  9. iSCSI troubleshooting : Targets Not Detected After Reboot
  10. dpkg-reconfigure Command Options

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright