如何进行linux下虚拟盘加密,会的给个具体步骤
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何进行linux下虚拟盘加密,会的给个具体步骤相关的知识,希望对你有一定的参考价值。
参考技术A LINUX下有对应的硬盘加密软件,你到软件中心去找找看吧!个人建议不要做加密,做个隐藏就行了。软件有时会出错,到时候叫你用不能用那就糟了! 参考技术B Create one or more partitions on the drive:cfdisk /dev/sdb
I created one big 300 GB partition, /dev/sdb1.
Setup LUKS:
cryptsetup --verbose --verify-passphrase luksFormat /dev/sdb1
Enter a good passphrase here. Don't spoil the whole endeavour by chosing a stupid or short passphrase.
Open the encrypted device and assign it to a virtual /dev/mapper/samsung300gb device:
cryptsetup luksOpen /dev/sdb1 samsung300gb
Create a filesystem on the encrypted device:
mkfs.ext3 -j -m 1 -O dir_index,filetype,sparse_super /dev/mapper/samsung300gb
I used ext3 with some optimizations, see mke2fs(8).
Mount the encrypted partition:
mkdir /mnt/samsung300gb
mount /dev/mapper/samsung300gb /mnt/samsung300gb
That's it. Everything you write to /mnt/samsung300gb will be encrypted transparently.
For unmounting use:
umount /mnt/samsung300gb
cryptsetup luksClose /dev/mapper/samsung300gb
网上抄的,大概步骤,详细的自己看下cryptsetup相关文档 参考技术C 是不是想用cryptsetup,要提供密码才能mount的那种?
以上是关于如何进行linux下虚拟盘加密,会的给个具体步骤的主要内容,如果未能解决你的问题,请参考以下文章
如何将安装好的centos7 Linux系统,制作成全盘还原gho镜像?