Post updated.
After endless searching with Google, many failed experiments and various incazzature, I managed to create a filesystem / home encrypted on OpenBSD 4.0 without the use of particular programs, but with only the tools in the system.
The steps work properly with a partition 3GiB. Some guides report that the device can not exceed snvd the size of 8GiB. From some tests I made I would say that they are wrong. I assume that this procedure will work with higher dimensions, but is not guaranteed. If you have a way to test different configurations, please let me know.
The partition is to be encrypted / home and corresponds to the BSD partition 'g'. Adapt to suit your needs.
Start by installing OpenBSD as usual. You create all the partitions as you need as /, / tmp, / var, / usr, and of course a separate / home.
Example: 16 partitions: # size offset fstype [fsize bsize cpg] a: 262017 63 4.2BSD 2048 16384 260 # Cyl 0 *- 259 b: 524160 262080 swap # Cyl 260 to 779 c: 19541088 0 unused 0 0 # Cyl 0 to 19,385 d: 262080 786240 4.2BSD 2048 16384 260 # Cyl 780-1039 e: 262080 1048320 4.2BSD 2048 16384 260 # Cyl 1040 to 1299 f: 12582864 1310400 4.2BSD 2048 16384 328 # Cyl 1300 to 13782 g: 5641776 13893264 4.2BSD 2048 16384 328 # Cyl 13783 to 19379
ends the installation and restart the system.
Now, when you are ready to start the `process` to encrypt the / home partition, it must first be removed; and then you have to work as `root` and `normal 'people can not be logged into the system.
addition, the file `/ etc / fstab 'should not contain more than the line that automatically mounts / dev/wd0g in / home.
# umount / home # dd if = / dev / zero of = / dev/wd0g bs = 1k
At this point the partition is associated to a device `g` `` snvd0.
# vnconfig snvd0-k / dev/wd0g Encryption key:
will be prompted to enter your password. MUST BE VERY CAREFUL as it can be entered only once A ! Do not miss the next association as only you can `scoprire` che la password era sbagliata...
A questo punto si deve configurare il dispositivo "virtuale" come se fosse un disco. Lo si deve `configurare` in modo che contenga due partizione: `a` e `c`. Entrambe devono avere la stessa dimensione della partizione `reale` `g`. `c` è di tipo `unused`, mentre `a` è di tipo 4.2BSD. Il risultato deve essere come nell'esempio:
# disklabel -E svnd0
disklabel: Can't get bios geometry: Device not configured
Initial label editor (enter '?' for help at any prompt)
> p
16 partitions:
# size offset fstype [fsize bsize cpg]
a: 5641776 0 4.2BSD ...
c: 5641776 0 unused ...
Now, you can format the partition `a`:
# newfs / dev/svnd0a
and is mounted on / home: # mount-o
softdep, nodev, nosuid / dev/svnd0a / home
The system is now ready for use. Note that all that is written to / home, it is actually written to the partition using the `g` `cipher blowfish`.
If you were to reboot the system, it shall automatically be stripped of the partition. However, when it will return `active`, the / home partition is not mounted. `` To activate it do the following:
# K-vnconfig svnd0 / dev/wd0g Encryption key:
and type the correct password.
Now you can reassemble and check that the password is correct: # mount-o
softdep, nodev, nosuid / dev/svnd0a / home
If the system were to make a mistake and say that the partition contains a fs FFS, it means that the password is incorrect.
If all goes well, you can enjoy the / home partition encrypted!