1。安装加密软件
cadenwu@cadenwu-laptop:~$ sudo apt-get install cryptsetup
|
2. 添加相应模块,在/etc/profile
# for luks
sudo modprobe cryptoloop
sudo modprobe dm_crypt
|
3. 编写启动和关闭脚本
#启动脚本
cadenwu@cadenwu-laptop:~/Bin$ cat cstart
#!/bin/bash
sudo cryptsetup luksOpen /dev/sda10 luks
sudo mount /dev/mapper/luks /home/cadenwu/Crypt/
#关闭脚本
cadenwu@cadenwu-laptop:~/Bin$ cat cstop
#!/bin/bash
sudo umount /home/cadenwu/Crypt
sudo cryptsetup luksClose /dev/mapper/luks
|
(PS:我这里是将/dev/sda10作为要加密的分区)
阅读(1270) | 评论(0) | 转发(0) |