OpenBSD server full story
>>> becoming the testuser
# su - testuser
>>> creating the encrypted directory (this is where the encrypted content is stored, you will not directly write to this directory). The key will need to be at least 16 characters long.
$ cmkdir cryptotest
Key:
Again:
>>> attaching the the encrypted directory. You will need to enter the
key used during the creation of it.
$ cattach cryptotest
Key:
>>> The directory will be mounted under /crypt/yourdirectoryname
$ ls -l /crypt/
total 4
drwx------ 2 testuser users 512 Apr 24 17:52 cryptotest
>>> It is handy, to have a symlink to /crypt/yourdirectoryname in your home folder in order to easily access it.
$ ls -l
total 8
lrwxr-xr-x 1 testuser users 17 Apr 24 17:51 crypto -> /crypt/cryptotest
-rw-r--r-- 1 testuser users 473 Apr 24 18:05 cryptodemo.txt
drwxr-xr-x 2 testuser users 512 Apr 24 17:52 cryptotest
>>> you can now use the attached directory similar to normal
directories. All files and folders will be displayed normally.
>>>> listing and display files
$ ls -l crypto/
total 4
-rw-r--r-- 1 testuser users 28 Apr 24 17:53 testuserstest.txt
$ more crypto/testuserstest.txt
coolio
testing cfs
blabla
>>>> creating new files
$ echo "Here is the testtext" > crypto/anothertest.txt
$ ls -l crypto/
anothertest.txt testuserstest.txt
$ ls -l crypto/anothertest.txt
-rw-r--r-- 1 testuser users 21 Apr 24 18:06 crypto/anothertest.txt
$ more crypto/anothertest.txt
here is the testtext
>>> Detaching the encrypted folder
$ cdetach cryptotest
>>> displaying the content of the encrypted folder
$ ls -l cryptotest
total 8
-rw-r--r-- 1 testuser users 36 Apr 24 17:53 3cf0c57e1d05151c8411060c4df1079571f930e52a540d56
-rw-r--r-- 1 testuser users 29 Apr 24 18:06 4a70ceadb5cd9a19adcca8ae12994c41
>>> Displaying Files in the encrypted folder
$ cd cryptotest/
$ more 3cf0c57e1d05151c8411060c4df1079571f930e52a540d56
somescrambledtext