configuration
In this configuration, there is a separation between system and data.- partitions:
1 - system encrypted with luks
2 - data encrypted in a truecrypt FAT32 partition,
- /tmp and /home are in a tmpfs. The user preferences are loaded at each startup from data partition,
- no swap,
The system will be installed and configured using an Ubuntu USB drive and the script infondLinux.
wipe data
From an Ubuntu USB key (or CD):
- use gparted to create a unique partition,
- mount (let's assume the partition is /dev/sda1)
# mkdir /media/disk- wipe (launch and go to bed)
# mount /dev/sda1 /media/disk
# touch /media/disk/full
# dd if=/dev/urandom of=/media/disk/full
# rm /media/disk/full
install your system
install Ubuntu
partitions:1 - system encrypted with luks encryption
2 - data not encrypted (later encrypted with truecrypt FAT32 partition,
3 - an unsecured partition is kept for VMs, films... (performances reasons).
no swap!
FAT32 is used in case you would like to access your data from Windows
.bash_history -> /dev/null
$ su -
# for user in $(ls /home); do rm /home/$user/.bash_history; ln -s /dev/null /home/$user/.bash_history; done
create TrueCrypt partition
use the whole data partition as TrueCrypt volumeinstall Infondlinux
# wget http://infondlinux.googlecode.com/svn/trunk/infondlinux.sh
# sudo infondlinux.sh
save your preferences
Most of programs put your configuration preferences in home. You'll need to save your current home in the data partition each time you modify your preferences.
This configuration will be loaded at each boot. we'll deal with this loading later.
delete /home
# for user in $(ls /home); do rm -r /home/$user; mkdir /home/$user; done
Reboot and configure as you like your gnome desktop and programs (firefox, xchat, chrome, wifi, seahorse, etc.)
close all windows, open your truecrypt partition and run (sudo)
# mkdir /media/truecrypt1/savehomeDon't forget, you'll need to save your preferences often if you don't want to reconfigurate your softs at each boot.
# cp -r /home/* /media/truecrypt1/savehome
let's become invisible
create tmpfs
modify /etc/fstab$ su -
# echo "none /tmp tmpfs defaults,size=128M 0 0" >> /etc/fstab
# echo "none /home tmpfs defaults,size=512M,mode=1777 0 0" >> /etc/fstab
truecrypt prompt to load your /home at each gnome start
add (just under first comments) into /etc/gdm/Init/Default
(replace /dev/sda3 by your data partition) :
# mount truecrypt
truecrypt /dev/sda3 /media/truecrypt1
# load /home
cp -r /media/truecrypt1/savehome/* /home
# umount truecrypt
truecrypt -d /dev/sda3
# chown
for user in $(ls /home); do
chown -r $user:$user /home/$user
done
Ok, pourquoi pas. Mais n'est il pas possible de faire plus simple avec unionfs?
RépondreSupprimerDans le rc.local, un:
mount -t unionfs -o dirs=/tmpfs:/home=ro none /home
(la syntaxe est a adapter bien sur). Avec cette méthode, tous les changements fait dans /home ne sont enregistrés que dans le ramdisk.
De cette manière, les changements dans /home ne sont pas persistants (/tmpfs est monté en ram, bien entendu).
De plus, pour l'usabilité de la méthode, il est possible de monter à la demande à l'aide du /proc/cmdline.
Dans le rc.local, si le /proc/cmdline détecte une certaine valeur alors unionfs monte en overlay un ramdisk sur home. Sinon, rien.
if grep -q paranoid /proc/cmdline
then
modprobe unionfs
mount etc...
fi
Et modifier le chargeur au boot pour proposer un second système:
menuentry "My paranoia on (hd0,1)" {
set root=(hd0,1)
linux /vmlinuz root=/dev/hda1 paranoid
initrd /initrd
}
Pour bash, oui, aussi, mais il existe pleins d'autres manières de gérer son historique:
http://blog.uggy.org/post/2006/07/05/98-petits-trucs-pour-configurer-l-historique-du-bash au hasard, premier lien google.
super trick! thanks Kevin!
RépondreSupprimerAh, et /home et /tmp ne suffisent généralement pas. Entre autre j'ai en tête le /var/tmp
RépondreSupprimerhttp://www.pathname.com/fhs/pub/fhs-2.3.html#VARTMPTEMPORARYFILESPRESERVEDBETWEE
qui sert de stockage temporaire qui doit survivre aux reboots. Je crois que konqueror s'en sert pour ses miniatures. Donc /home a beau être wipé, s'il reste pleins de choses dans /var/tmp c'est un peu raté. Je suis à peu près certain que Gnome s'en sert aussi.
En fait, c'est un peu pour cette raison qu'on chiffre soit rien, soit l'intégralité du filesystem, on ne sait jamais ou des fichiers vont être posés ou enregistrés.