分类: LINUX
2008-04-26 18:19:00
Cryptmount设置是Linux内核在设备映射层完成的,这就意味着你可以在加密设备映射块文件上创建任意受支持的文件系统类型。Cryptmount处理设备映射加密并挂载文件系统,Cryptmount的简单用法不需要你知道任何细节。
Cryptmount打包在Ubuntu Gutsy Universe中,在一些Slackware和Gentoo社区中也可下载,在Cryptmount的项目主页()上也可以下载到RPM包。默认情况下,cryptmount-setup倾向于在/home目录下创建一个目录用于存放加密内容。
# cryptmount-setup
********************************
* cryptmount setup script 【cryptmount配置脚本】
*
* This program will allow you to setup a secure filing-system that will
* be managed by "cryptmount". You will be able to select basic features
* such as the location and size of the filesystem - if you want more
* advanced features, you should consult the cryptmount manual page.
*【这个程序将允许你通过cryptmount设置一个安全的文件系统,你可以选择基
本的特征如位置和文件系统的大小,如果你想要更多的高级特征,你应该
参考cryptmount的帮助手册】
...
Please enter a target name for your filesystem
【为你的文件系统输入一个名字】
[opaque]: my-encrypted-files
Which user should own the filesystem (leave blank for root)
【哪个用户拥有该文件系统,留空表示root所有】
[]:
Please specify where "my-encrypted-files" should be mounted
【请指出my-encrypted-files将挂载在哪里】
[/home/crypt]:
Enter the filesystem size (in MB)
【输入文件系统的大小】
[64]: 256
Enter a filename for your encrypted container
【给你加密的容器指定一个文件名】
[/home/crypto.fs]:
Enter a location for the keyfile
【输入本地的密钥文件】
[/etc/cryptmount/my-encrypted-files.key]:
...
enter new password for target "my-encrypted-files":
【为my-encrypted-files指定一个新密码】
confirm password:
【再输入一次密码】
Formatting encrypted filesystem...
【正在格式化文件系统】
enter password for target "my-encrypted-files":
【为my-encrypted-files输入密码】
Your new encrypted filesystem is now ready for use.
【现在你的加密文件系统已经可以使用了】
To access, try:
【要访问,尝试下面的命令】
cryptmount my-encrypted-files
cd /home/crypt
After you have finished using the filesystem, try:
【在你使用完文件系统后,尝试下面的命令】
cd
cryptmount --unmount my-encrypted-files
# cryptmount my-encrypted-files
enter password for target "my-encrypted-files":
e2fsck 1.40.2 (12-Jul-2007)
/dev/mapper/my-encrypted-files: clean, 11/65536 files, 18561/262144 blocks
# df /home/crypt
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/my-encrypted-files
253871 10288 230476 5% /home/crypt
|
注意cryptmount --unmount消息,尽管Linux内核会把/home/crypt看做另外一个文件系统,但你仍然不能umount /home/crypt,因为Cryptmount仍然认为它是激活的,如果你那样做了,内核文件系统将不能卸载,但是Cryptmount可以让你重新挂载它,并给你一个消息“create ioctl failed: Device or resource busy”。