Tag Info

Hot answers tagged

8

In most scenarios, one of the following three schemes works well. You only want to encrypt a few particularly confidential files. Use encfs: mkdir ~/.encrypted.d ~/encrypted encfs ~/.encrypted.d ~/encrypted editor ~/encrypted/confidential-file Pros: no overhead to access non-confidential files; you can have different hierarchies with different ...


7

Warning, wall of text incoming. It's as well formatted as I could make it. If we're going to answer this, we're going to answer the whole thing. I'm not doing another answer on this, so here goes: Let's pretend you know absolutely nothing, and I'm feeding you keystrokes. This tells you everything you need to know to do this WHOLE thing, with a little ...


6

Backup Reformat Restore cryptsetup luksRemoveKey would only remove an encryption key if you had more than one. The encryption would still be there. The Fedora Installation_Guide Section C.5.3 explains how luksRemoveKey works. That it's "impossible" to remove the encryption while keeping the contents is just an educated guess. I base that on two things: ...


6

Many Linux distributions use an in-memory filesystem as a temporary root filesystem when booting. There are two forms of such in-memory filesystems: initrd, the traditional form, which is a RAM drive, and initramfs, the modern form, which is a filesystem filled by data from an archive. The job of the programs on the initrd (or initramfs, the difference is ...


5

If you do not overwrite the previous contents of the disk, any old information will remain in a trivially (software-only) readable form until it happens to be overwritten, which may be a very long time (bordering on forever). If you do overwrite the previous contents of the disk with zeroes before creating the LUKS data structures on-disk, you have largely ...


5

This uuid "EFc551-(...)" probably is your 2TB disk (namely encrypted PV on it). You need to tell somehow your initramfs about this second PV. Probably update-initramfs will do it, something like (from knoppix): (assuming you've mounted your disk in /mnt/disk) cp -a /dev/* /mnt/disk/dev/ chroot /mnt/disk mount /proc mount /sys update-initramfs -u ...


4

After backing up (step 1) and unmounting (between 2 and 3), run fsck to ensure that the filesystem is healthy: e2fsck -f /dev/mapper/ExistingExt4 Other than that, the steps are OK. what should I choose for $SECTORS? Is this step even necessary? This step is necessary, otherwise the partition would still show up at the old side. This is confirmed ...


4

Did you update on your 2TB hdd the /etc/fstab to point to the correct UUID of the encrypt volume? In case you don't know what is the UUID of the encrypt volume you can check by issuing the cmd: cryptsetup -v status /dev/ After you need to update your /etc/fstab and the grub configuration to point to the correct UUID. This should solve your question ...


4

In fact, modifying mount is possible, as I learned from the existence of mount.ntfs-3g. I'm doing only guesswork, but I suspect mount -t sometype results in a call to mount.sometype $DEV $MOUNTPOINT $OPTIONS, feel free to correct me here or quote some actual documentation. Especially the option -o loop is already treated so there's no need for lopsetup ...


4

Your approach looks good. Some remarks though: If you want to encrypt rootfs, you'll need to use initrd (to have some minimal unencrypted system that will process the encrypted partitions). If the USB device is removable, both initrd and kernel can be stored on the USB to heighten tamper resistance (supposing you make sure the USB won't get into ...


4

It doesn't work because the /etc/crypttab line is missing the option keyword luks. Changing the line to this resolved the issue: luks-01a2e5d8-9211-40ce-b160-d3f973d1a155 UUID=01a2e5d8-9211-40ce-b160-d3f973d1a155 /etc/luks-keys/luks-01a2e5d8-9211-40ce-b160-d3f973d1a155 luks,nofail This is due to the fact that cryptdisks_start uses the options to determine ...


4

1a - it really doesn't matter all that much. which ever hash you use for the key derivation function, LUKS makes sure it will be computationally expensive. It will simply loop it until 1 second real time has passed. 1b - the key derivation method has no influence on performance. the cipher itself does. cryptsetup benchmark shows you as much. 2 - AES is the ...


3

It depends on why you need encryption. If the backup disk is safe at home and you encrypt your laptop because you worry about it being stolen on the go, it's probably fine to have the backup unencrytped. Of course that doesn't help you any if someone breaks into your home. If you need encryption everywhere, naturally you have to use LUKS for the backups ...


3

Yes, you can find the information in /sys/block/$DEVICE/slaves. If you only have the canonical name you can use readlink to get the details, e.g: devdm="$(readlink -f /dev/mapper/extern-1-crypt)" dm="${devdm#/dev/}" ls /sys/block/$dm/slaves/ If you want to remove all you can just utilize directly the sys filesystem: echo 1 > ...


3

What you call “standard” partitions are IBM PC partitions. The point of using them is to be compatible with other operating systems that like or even require IBM PC partitions. Inside a Linux software RAID volume, or inside a LUKS encrypted volume, only Linux cares. So you might as well use Linux's native partitioning system, i.e. LVM, which is a lot more ...


3

There's a evident wrong configuration: lvm_crypt /dev/sda5 none luks You decrypted the volume and named it lvm_crypt while mounting /dev/mapper/mint-root Were you asked to input the password during boot ? Also, did you updated initramfs afterwards ? Because this crypttab need to be embedded since it's for root partition. EDIT mint_root /dev/sda5 none ...


3

The dropbear (ssh server) is supposed to be started very early during boot phase - earlier than the init (rcN.d) sequence and firewall init scripts; even earlier than / is mounted (it is encrypted too, right?). So it comes to initramfs, the pre-/ userland loaded for kernel by boot loader. The image is (re)generated by update-initramfs -u from contents of ...


3

You should definitely go with luks as it is integrated with the Linux kernel and will work out of the box. Using other solution is not really worthwhile especially since some of them won't support AES-NI. For a discussion about what to encrypt have a look at Any reason for encrypted /? but depending on your paranoia level and security needs just encrypting ...


3

I don't think something like this exists right out of the box, but it should be possible. I'll put together some references for you. First there's /etc/crypttab - typically you specify a key file or password in the third slot, but some distros allow you to specify an option in the fourth field called keyscript (debian and opensuse support this: ...


3

It's unusual to have partitions on a LUKS device. The partition device may also be called linuxp1. If it's not there, you can use one of partx, kpartx, or losetup --partscan to make partition devices available. You can also map it manually using losetup --offset.


3

The LUKS format has multiple key slots, each one may contain the encrypted master key that is used for data encryption. This master key is encrypted using another key which is derived from your passphrase. Using plain hash_function(passphrase) to generate a key would be dumb as hashes such as sha1 can be calculated fast (SHA-1 is an example of a MAC ...


3

The easiest way to solve this is to add a derived key from the first partition to to the second disk by running: /lib/cryptsetup/scripts/decrypt_derived sda1_crypt > new_key_file cryptsetup luksAddKey /dev/sdb1 new_key_file # prompts for an existing key shred -u new_key_file # remove the key file Then replace the sdb1_crypt line ...


2

Short answer: No. You could have multiple keys in different slots , but that's not related to your question. For security , I maintain a checksum for ramdisks and cryptsetup is statically linked , and I check them automatically everytime I boot. UPDATE The checksum is stored on encrypted FS , you can't modify it until you mount that partition. That is , ...


2

You can use /lib/cryptsetup/scripts/decrypt_derived in your crypttab to automatically use the key from one disk for another. The decrypt_derived script is part of Debian's cryptsetup package. Small example to add the key from sda6crypt to sda5: /lib/cryptsetup/scripts/decrypt_derived sda6crypt > /path/to/mykeyfile cryptsetup luksAddKey /dev/sda5 ...


2

You might be stuck using a kickstart to define the partition with the encryption type instead of using the graphical install interface.


2

Tried my best to stay posix with this, note that it will fail if you do not have a suitable "udevadm" package available for displaying udev info. #!/bin/bash command_exists () { type "$1" &> /dev/null } CMD="" if command_exists udevadm; then CMD="$(which udevadm) info -q all -n" fi if command_exists udevinfo; then CMD="$(which ...


2

There is a lot of possibilities: :> # 1 :> pvscan :> # 2 :> vgscan -v extern-1 :> # 3 :> dmsetup table /dev/mapper/extern-1-crypt :> # 4 :> cd /sys/devices/virtual/block/ :> for dmdev in dm-*; do :> if [ xyz = $(< "${dmdev}/dm/name") ]; then :> ls -l "${dmsev}/slaves/" :> fi :> done Or take the "dm-" ...


2

You can use gpart to search for file systems on /dev/dm-2. After that or even as an alternative you can create dm volumes without LVM using dmsetup directly. On my systems the first LV always starts at offset 384: dmsetup create restore-lv --table "0 25165824 linear /dev/dm-2 384" The size is not important (and usually wrong) for the test. Then you check ...


2

I'm not familiar with Xen. With KVM, I'd just make the VM boot up in a rescue or live CD, and chroot from there. As you would do if you had this problem on your real desktop. If all you need is an offset, in general you can use losetup for that. Or more specifically offsets for partition tables, you can use partx or kpartx. If you have a partitioned LV, ...


2

If you want a per user encryption, Ubuntu already offers a solution for that I believe. It doesn't use dm-crypt/luks but ecryptfs or similar, to encrypt each users home directory individually, using an encrypted layer on top of the regular filesystem. As for dm-crypt/luks, you'd have to create a separate partition or logical volume for each user to achieve ...



Only top voted, non community-wiki answers of a minimum length are eligible