fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

8.6K
active users

#cryptsetup

0 posts0 participants0 posts today

My experience with #FlashDrives recently has been mixed. I have no problem in encrypting them with #LUKS, using #cryptsetup or with formatting a partition with #Btrfs, for instance, using #gparted and doing other tinkering with #Gnome #disks. But the problem has been with the actual drives themselves. The cheaper ones seem to have quite a few bad sectors, etc. and so they’re not really reliable for medium term storage.

1/2

Зашифрованные флешки и переносные hdd, поддерживаются почти всеми линуксами «из коробки».

Если на windows’ах для работы с флешкой использовалось
#VeraCrypt или даже #TrueCrypt, то на linux-системах с этой же флешкой можно и через #cryptsetup работать. Без надобности устанавливать дополнительные приложения, сродни того же VeraCrypt.

Подключить целиком зашифрованную флешку:

sudo cryptsetup open --type tcrypt /dev/sdXY myconfidential


Будет запрос пароля для sudo и потом пароль для доступа к зашифрованному разделу. Содержимое доступно после монтирования:
sudo mkdir /mnt/secureflash
sudo mount /dev/mapper/myconfidential /mnt/secureflash


Несколько лет назад
#VeraCrypt пришло на замену #TrueCrypt, но поддержка старых контейнеров TrueCrypt’а имеется ещё везде.

Можно поставить удобства ради и VeraCrypt, кросс-платформенное, но если не установлено на машине с линуксом, то это и не проблема.

Прекращение работы с зашифрованным носителем данных:
размонтировать из файловой системы (записать все закешированное),
закрыть сам по себе крипто-контейнер.

Выполняется в две команды:
sudo umount /mnt/secureflash 
sudo cryptsetup close myconfidential 


Точнее в три команды, если удалять ставшим не нужным
/mnt/secureflash.

Когда непонятно под каким
/dev/sdXY числится флешка, то поможет: lsblk -f или что-то схожее, на вкус и цвет более подходящее.

#криптография #инфобез #infosec #linux #opensource

Восстановление данных с зашифрованного Linux тома с помощью cryptsetup

В этой статье мы разберем восстановление данных с зашифрованного с помощью LUKS тома NAS. Внимание : в самом худшем случае для восстановления данных этим способом потребуется свободное место равное двум объемам зашифрованного раздела. Например, если у вас есть зашифрованный раздел на 1 ТБ, то необходимо иметь 2 ТБ свободного места. В лучшем случае (незначительные повреждения) понадобится один объем свободного дискового пространства. Также обращаем внимание, что вам НУЖНО ЗНАТЬ пароль, который использовался для шифрования тома Для примера мы будем использовать диск от QNAP с зашифрованном разделом. 1. Подключаем диск от QNAP к компьютеру с помощью USB или SATA. После чего нужно любым доступным способом создать образ зашифрованного раздела. Для примера мы будем использовать программу Vолга. Выбираем раздел QNAP и начинаем создание образа. Мы советуем сохранить образ в формате .img (посекторный RAW образ) на любой внешний диск.

habr.com/ru/articles/855290/

ХабрВосстановление данных с зашифрованного Linux тома с помощью cryptsetupВ этой статье мы разберем восстановление данных с зашифрованного с помощью LUKS тома NAS. Внимание : в самом худшем случае для восстановления данных этим способом потребуется свободное место равное...

#Fedora #Kinoite #Anaconda still has the same bug as half a year ago...

bugzilla.redhat.com/show_bug.c

Doing my "zygote" trick again, small install of Kinoite on a secondary SSD, cloning with #clonezilla, #btrfs resizing and balance, done.

Luckily I dont use that install much, and #cryptsetup allows to change the password.

#Linux just always finds a way!

bugzilla.redhat.com2297460 – Anaconda boot fails, missing kernel cmd arg, Kinoite 41 Beta

Dear fellow users, I need your assistance while I'm trying to encrypt my root partition:

The Arch Linux wiki (wiki.archlinux.org/title/Dm-cr) has some guide to first unmount and then shrink the partition before reencryption, but then it has a header saying "cryptsetup 2.2 using LUKS2 supports online encryption/decryption/reencryption". Does that mean I can skip the unmount and resize, and just run the reencrypt command when the OS is still running on that partition?

wiki.archlinux.orgdm-crypt/Device encryption - ArchWiki

Had fun and games trying to unmount my work volume (a LUKS loopback device) today… `cryptsetup` telling me the device was in-use. (But it wasn't!)

As it happens, kernel namespaces can make things appear to be "in use" when they are not, and Gentoo's Portage uses namespaces to isolate the build process from the host system. Kill the build, and you'll be able to unmount and de-activate the encrypted volume.

forums.gentoo.org/viewtopic-p-

forums.gentoo.orgGentoo Forums :: View topic - [SOLVED] cryptsetup cannot close device which is unmounted

Quick guide on encrypting an external drive. Assuming the drive is at /dev/sda with a /dev/sda1 partition

Set up encrypted volume (-y for verifying the password)
# cryptsetup luksFormat -y -v /dev/sda1

Unlock the encrypted volume and create a mapping to /dev/mapper/DUDE
# cryptsetup luksOpen /dev/sda1 DUDE

Create a file system
# mkfs.ext4 /dev/mapper/DUDE

Mount the partition
# mkdir /mnt/DUDE
# mount /dev/mapper/DUDE /mnt/DUDE

Continued thread

"A swap file can be used to reserve swap-space within an existing partition & may also be setup inside an encrypted blockdevice's partition."
So all I had to do is make sure swap file is setup in fstab & just point all resume=UUID= to the UUID of primary partition where the #swap file is & that is it. my brain exploded🤯 from how easy it was.
p.s. reminder to anyone doing #LUKS it is only as good as the password you pick so pick something good!
#CryptSetup #Linux #LVM #hibernate #DiskEncryption

Long ago when I was installing #Kali #Linux on my #Dell Latitude E5570 #Laptop
I went with LVM on LUKS wiki.archlinux.org/title/dm-cr
& at the time I thought I'd go with a swap file on / (I was unaware of Swap crypt🙄)
I was never able to get hibernate to work, until now😀...
Let me say many websites & forums all say if you want hibernate to work on LUKS, you have to go with swap crypt.
Not true, if you read wiki.archlinux.org/title/Dm-cr
#CryptSetup #LVM #LUKS #SWAP #hibernate #DiskEncryption

wiki.archlinux.orgdm-crypt/Encrypting an entire system - ArchWiki