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

创建centos7下的加密移动硬盘

2015-08-27 09:29 507 查看

创建centos7下的加密移动硬盘

机器山插了一块移动硬盘,为了安全,使用了加密方法:

代码如下:

cryptsetup luksFormat /dev/sdb
cryptsetup luksOpen /dev/sdb cryp
dd if=/dev/urandom of=/root/keyfile1 bs=1024 count=4
chmod 0400 /root/keyfile1
cryptsetup luksAddKey /dev/sdb /root/keyfile1
mkfs.xfs /dev/mapper/cryp
echo "/dev/mapper/cryp /mnt/1t xfs defaults 1 2" >> /etc/fstab
echo "cryp /dev/sdb /root/keyfile1 luks" >> /etc/crypttab
mount -a


参考:http://geekpeek.net/disk-encryption-on-centos-linux/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: