发新话题
打印

【求助】求助如何加密文件夹而不影响使用

【求助】求助如何加密文件夹而不影响使用

一个棘手的问题,希望高手给些提示和方法:
Linux操作系统,远程用户如果登录以后,能够访问某些特定的文件或者文件夹,甚至拷贝相应的内容,导致一些重要文件的丢失,因此有个想法
(1)增加一道屏障,把重要的文件夹加密,包括文件夹里的文件
(2)远程用户或者本地用户访问时需要输入访问密码
(3)远程用户或者本地用户拷贝时也同样需要拷贝密码
(4)不影响该目录的使用,也就是说,如果原来未加密之前的文件夹里面是一段源程序,能够正常的编译,链接甚至远程调试,希望加密后也不影响这些功能

我看到一个磁盘加密的软件,也是修改内核的,但是还不太明白怎么用,是否能满足我的要求,所以在这里问问高手们有没有简单的,快速的办法,或者什么路子。      

TOP

用系统自带的loop就可以完成, 参考这里的第二部分 loop-AES

http://www.linux.com/article.pl?sid=06/03/13/1656228      
Advance Monitor - Linux Monitoring Solution

TOP

谢谢版主,我先看看,有问题再向你请教      

TOP

Roc.Ken版主
我试着用loop-aes, 但是没有搞定。你给的链接是debian里的方法。我是直接在redhat9上作的,根据安装说明重编了内核,loop-aes也成功地安装,但是在使用的时候提示找不到设备"/dev/loop7",可是我看了该目录下,有loop7文件,不知道什么原因,就是不能用,指点一下,谢谢。      

TOP

可否给出详细的出错信息,
如果是redhat系列的系统, 默认就有这些加密用的模块:

# cat /etc/redhat-release
Red Hat Enterprise Linux AS release 4 (Nahant Update 3)
# modprobe -l blowfish        
/lib/modules/2.6.9-34.0.1.ELsmp/kernel/crypto/blowfish.ko
# ls /lib/modules/2.6.9-34.0.1.ELsmp/kernel/crypto
arc4.ko      cast5.ko  crc32c.ko       deflate.ko  khazad.ko  md5.ko          serpent.ko  sha512.ko  twofish.ko
blowfish.ko  cast6.ko  crypto_null.ko  des.ko      md4.ko     michael_mic.ko  sha256.ko   tea.ko     wp512.ko

以 blowfish 为例:
#insmod /lib/modules/2.6.9-34.0.1.ELsmp/kernel/crypto/blowfish.ko  ####加载模块
# dd if=/dev/urandom of=./encrypt  bs=1k count=4096                     ####创建文件
# losetup -e blowfish /dev/loop0 ./encrypt                                          ####和loop设备关联,并让通信加密.
Pass phrase: Your_PASSWORD_HERE                                            ####记住密码,以后安装该文件系统时需要.
# mkfs -t ext3  /dev/loop0       #创建文件系统
# losetup -d /dev/loop0        #去掉关联
#mkdir /mnt/myfs           
# mount ./encrypt -o loop=/dev/loop0,encryption=blowfish /mnt/myfs -t ext3 #安装加密的文件系统
Password: Your_PASSWORD_HERE

以后你就可以像使用 /home 分区一样使用这个文件系统, 同系统的其他用户也可以正常访问; 密码的限制只有再挂载的时候生效, 可以在使用完后, umount掉这个文件系统.
mount/umount需要root权限完成,可以写在sudoers文件中.      
Advance Monitor - Linux Monitoring Solution

TOP

这篇文章也可以参考一下
http://man.lupaworld.com/content ... ebian.htm#id2808444      

TOP

有工具软件的

Free open-source disk encryption software for Windows XP/2000/2003 and Linux Main Features: Creates a virtual encrypted disk within a file and mounts it as a real disk. Encrypts an entire hard disk partition or a device, such as USB flash drive. Encryption is automatic, real-time (on-the-fly) and transparent. Provides two levels of plausible deniability, in case an adversary forces you to reveal the password: 1) Hidden volume (steganography – more information may be found here). 2) No TrueCrypt volume can be identified (volumes cannot be distinguished from random data). Encryption algorithms: AES-256, Blowfish (448-bit key), CAST5, Serpent, Triple DES, and Twofish. Mode of operation: LRW (CBC supported as legacy). Based on Encryption for the Masses (E4M) 2.02a, conceived in 1997. Further information regarding features of the software may be found in the documentation. http://www.truecrypt.org/      

TOP

发新话题