Re: Easiest Way to Encrypt /home

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Aaron Stellman
Date: Tuesday, April 14, 2009 - 2:44 pm

On Tue, Apr 14, 2009 at 01:51:59PM -0700, new_guy wrote:
no need for custom kernel, read mount_vnd(8). you can also run this
script at boot to mount your /home after getting correct password from
user:

#!/bin/sh
# mount crypto partition

COUNTER=0
MAX_TRIES=3
SALT=/crypto/home.slt
IMG=/crypto/home.img
ROUNDS=20000
MOUNT_PNT=/home
DISK=svnd0
PART=c
MOUNT_OPTS="rw,nodev,nosuid,softdep"

if [ ! -f $IMG -o ! -f $SALT ]; then
	echo "[-] $IMG or $SALT not found"
	exit
fi

#echo

while [ $COUNTER -lt $MAX_TRIES ]
do
	sleep $(($COUNTER*2))
	echo "[+] Mounting $MOUNT_PNT"
	/sbin/vnconfig -K $ROUNDS -S $SALT $DISK $IMG
	/sbin/fsck -y /dev/$DISK$PART
	/sbin/mount -o $MOUNT_OPTS /dev/$DISK$PART $MOUNT_PNT

	if [ $? != 0 ] ; then
		/sbin/vnconfig -u $DISK
		COUNTER=$(($COUNTER+1))    
	else
		echo "[+] Success."
		exit			#normal exit point
	fi

done

echo "[-] Failure."
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Easiest Way to Encrypt /home, new_guy, (Tue Apr 14, 1:51 pm)
Re: Easiest Way to Encrypt /home, Aaron Stellman, (Tue Apr 14, 2:44 pm)
Re: Easiest Way to Encrypt /home, Raimo Niskanen, (Wed Apr 15, 12:06 am)
Re: Easiest Way to Encrypt /home, Daniele Pilenga, (Wed Apr 15, 12:21 am)