Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Debian (Sarge), Red Hat, Ubuntu, Knoppix
Posts: 99
Rep:
Encrypt /home and USB-memory
Hi,
1) I would like to encrypt /home, what would be a simple approach to do this?, the algorithm does'nt really matter, but I want it more secure than e.g. DES.
2) Also I would like to encrypt my USB-memory, I am using FAT32 on that memory because I want to be able to read it from Windows as well. Is it possible to encrypt it so I will be able to unencrypt it in Linux and as well in Windows?
Distribution: Debian (Sarge), Red Hat, Ubuntu, Knoppix
Posts: 99
Original Poster
Rep:
Thanks mattLSO for the tip, it turned out that cryptoloop is depreciated in krn 2.6.11 and you should now go for dm-crypt instead. I have tried it on my memorystick and it worked fine with ext3 and everything.
As dm-crypt is a device-mapper thing I have to load the following before I can mount the encrypted filesystem:
'cryptsetup create sda1 /dev/sda1' (I have to give my password at this stage)
and then 'mount /dev/mapper/sda1 /mnt/usbkey'
and the following to umount:
'umount /mnt/usbkey'
'cryptsetup remove sda1'
Now I want to try this out for my /home, but I have to run the cryptsetup thing before mount and after umount. I can put "/dev/mapper/sda1 /mnt/usbkey" in /etc/fstab, but what about the cryptsetup thing (that prompts me for my password). Where could I put the line to make it happen at the right time (before mount of /home and after umount of /home)
This will prevent it from being mounted on boot then in (On Debian, redhat is /etc/rc.d/init.d) /etc/init.d/ create a script called docrypto to run the commands, chmod 755 it then
Quote:
cd /etc/rc3.d
ln -s ../init.d/docrypto S10crypto
This will load your crypto commands on boot, as for unmounting when init changes runlevel on shutdown or reboot it calls the script with stop, just make sure it has the following format.
Quote:
#! /bin/sh
case "$1" in
start)
echo -n "Starting cryptographic system"
#put your start commands here
echo "."
;;
stop)
#shutdown commands
;;
restart)
stop()
start()
;;
*)
echo "Usage: docrypto (start/stop/restart)"
exit 1
esac
exit 0
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.