linux mount an encrypted disk/diskimgfile
2013-03-27 16:31
465 查看
How
can I encrypt a device with loop-aes under Linux?
up vote2down votefavorite 1 | Using Fedora/Ubuntu, how can I do it? linux encryption
| ||
|
1 Answer
activeoldestvotesup vote1down voteaccepted | You need patched kernel, losetup and mount. The package is usually called util-linux, you can get the patches from here. If you don't want to boot from a loop-aes device it's really simple: # Write 65 lines of random data to keyfile.txt This will be used as a key for # the data on the disk and your password will be as a key for this file. # You will need this file and the password to access your data. # Keep them safe. gpg -c --cipher-algo aes256 --digest-algo sha512 < keyfile.txt > keyfile.gpg rm keyfile.txt # Better if you never write this to disk in the first place. losetup -e aes256 -H sha512 -K keyfile.gpg /dev/loopX /dev/sdXX mke2fs -t ext4 /dev/loopX mount /dev/loopX /mnt # To mount it later mount -o loop=/dev/loopX,encryption=aes256,hash=sha512,gpgkey=keyfile.gpg /dev/sdXX /mnt If you want to encrypt the root partition then I recommend reading the extensive documentation. Basically you will need to create an initramfs and store it on an unencrypted boot partition. You can store the keyfile.gpg (and the boot partition if you decide to encrypt the root) on a removable USB device. |
相关文章推荐
- How to mount encrypted linux disk/diskIMGfile
- glance image-create --name "linux-core-mini-01" --file /cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --progress --visibility public
- 简单Dream-虚拟机加载linux加载光盘到mnt报错:mount: you must specify the filesystem type
- linux挂载硬盘重启后出现an error occurred during the file system check错误最有效的解决办法
- 在linux系统 挂载光盘:mount时提示: you must specify the filesystem type
- encrypted filesystemsdmsetup losetup and mount
- How to mount filesystems in Linux
- Linux 无法开机 an error occurred during the file system
- 虚拟机linux挂载光盘显示:mount: you must specify the filesystem type
- linux 下 eclipse 创建avd 出错 failed could not create temp file for system NAND disk
- Linux:mount: unknown filesystem type 'smbfs'
- linux 挂载光盘:mount: you must specify the filesystem type
- linux an error occurred during the file system check错误的解决
- 虚拟机linux挂载光盘显示:mount: you must specify the filesystem type
- linux出现an error occurred during the file system check
- [已解决]在VMware-server for linux 下装centos错误:an error has occurred. - no valid devices were found on which to create new file system
- How to Mount an NTFS Filesystem
- linux-mount: unknown filesystem type 'smbfs'解决方法记录
- mount: unknown filesystem type ntfs 解决方案 ntfs-g3(linux el5PAE)
- Linux挂载U盘报错:mount: unknown filesystem type 'ntfs'