您的位置:首页 > 运维架构 > Linux

CentOS中使用VeraCrypt(三):不使用向导创建加密磁盘

2017-02-07 14:38 447 查看

一、创建常规加密磁盘

我们使用单纯的命令行来实现在第一部分使用向导所完成的任务。

1、命令如下:

veracrypt -c \
--non-interactive \
--volume-type normal \
-v /dev/sdb \
--encryption aes \
--hash sha512 \
--filesystem Ext4 \
-p 123456 \
--random-source /root/anaconda-ks.cfg


2、参数详解:

参数说明
--non-interactive
执行命令行时不需要用户交互
-c
生成加密磁盘
--volume-type
这里指定加密磁盘的类型,是常规加密(
normal
)
还是隐藏加密(
hidden
),这里指定是的
normal
-v
指定待加密的设备,这里使用
/dev/sdb
--encryptihion
指定加密算法,这里使用
aes
--hash
哈希算法,这里使用
sha512
--filesystem
加密后使用的文件系统格式,这里使用
Ext4
-p
这里指定加密磁盘的密码
--random-source
指定一个文件做为随机字符来源,
可随意指定一个字符数大于320的文件
3、执行效果

[root@CenOS6A ~]# veracrypt -c \
--non-interactive \
--volume-type normal \
-v /dev/sdb \
--encryption aes \
--hash sha512 \
--filesystem Ext4 \
-p 123456 \
--random-source /root/anaconda-ks.cfg

Done: 100.000% Speed: 81 MB/s Left: 0 s

The VeraCrypt volume has been successfully created.


二、创建隐藏加密磁盘

我们使用单纯的命令行来实现在第二部分使用向导所完成的任务。

1、命令如下:

veracrypt -c \
--non-interactive \
--volume-type hidden \
-v /dev/sdb \
--encryption aes \
--hash sha512 \
--filesystem Ext4 \
-p 147258 \
--random-source \
/root/anaconda-ks.cfg \
--size 500M


2、参数详解:

这条命令大部分参数与创建常规加密磁盘一样,下面介绍二个不同的地方:

参数说明
--volume-type
加密磁盘类型这里指定的是hidden
-p
这里指定的密码是隐藏磁盘的密码,
需要和外层磁盘的密码不同
--size
指定隐藏盘的大小(K|M|G),这里指定为
500M
3、执行效果

[root@CenOS6A ~]# veracrypt -c \
--non-interactive \
--volume-type hidden \
-v /dev/sdb \
--encryption aes \
--hash sha512 \
--filesystem Ext4 \
-p 147258 \
--random-source \
/root/anaconda-ks.cfg \
--size 500M

IMPORTANT: Inexperienced users should use the graphical user interface to create a hidden volume. When using the text interface, the procedure described in the command line help must be followed to create a hidden volume.

Enter PIM:
Enter keyfile path [none]:
Done: 100.000% Speed: 100 MB/s Left: 0 s

The hidden VeraCrypt volume has been successfully created and is ready for use. If all the instructions have been followed and if the precautions and requirements listed in the section "Security Requirements and Precautions Pertaining to Hidden Volumes" in the VeraCrypt User's Guide are followed, it should be impossible to prove that the hidden volume exists, even when the outer volume is mounted.

WARNING: IF YOU DO NOT PROTECT THE HIDDEN VOLUME (FOR INFORMATION ON HOW TO DO SO, REFER TO THE SECTION "PROTECTION OF HIDDEN VOLUMES AGAINST DAMAGE" IN THE VERACRYPT USER'S GUIDE), DO NOT WRITE TO THE OUTER VOLUME. OTHERWISE, YOU MAY OVERWRITE AND DAMAGE THE HIDDEN VOLUME!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: