OpenBSD Journal

Using OpenBSD for an Encrypted File Server

Contributed by sean on from the an encrypted swap isn't going far enough off the deep end dept.

An anonymous 'john' writes:
A walkthrough and howto of how OpenBSD 3.6 was used to create an encrypted Samba server, including a web interface to manage BitTorrent collections, using the 3.6 package collection and the TorrentFlux-interface.

From the website "This is a fully-encrypted (samba)fileserver, which means that all the data that’s on there, actually can’t be found physically on the server :-) To be more precise, the data you copy to the server gets encrypted and the data you read from it gets decrypted, all on-the-fly…"

The write up and how-to is found at Making an encrypted fileserver.


I've only used the vnd devices for mounting and testing media images so this is a particularly interesting use for this flexible pseduo-device.

(Comments are closed)


Comments
  1. By ViPER (213.84.93.41) viper@dmrt.net on http://www.dmrt.net

    Finaly, a storage solution for my world domination plans !
    Great article :)

  2. By Anonymous Coward (66.131.207.182) on

    How reliable is a vnd mounted pseudo-device for suchs tasks? I'm curious. Does it have a tendency to fail, get corrupted, etc - are you screwed if those sectors go bad; then your data in that pseudo device is toast? TIA.

    Comments
    1. By Jonas (213.114.206.82) on

      Is it possible to use it direct on a partition? I don't like the loopback stuff.

      Comments
      1. By RC (4.8.16.53) on

        No, it's not possible (the encryption/decryption is part of "vnconfig", not "mount"), and not a smart thing to do even if it was possible.

    2. By Archite (69.238.133.30) adam@akarsoft.com on D. Adam Karim

      You should check out this page: http://www.xs4all.nl/~hanb/documents/OpenBSDEncryptedFilesystemHOWTO.html

      Comments
      1. By tedu (64.173.147.27) on

        or not, seeing how outdated it is.

        Comments
        1. By Anonymous Coward (213.89.220.64) on

          this was so sweet, i just love encryption. but i need better hardware :(

    3. By Jim (69.177.150.45) on

      You can't fsck an svnd device, which is annoying. You need to force mount it after the first time it doesn't get unmounted properly. Re-creating the filesystem is the only way to get rid of the "unclean filesystem" warnings. Also there's the fact that you can't fix correctable filesystems errors on encrypted filesystems...

      Comments
      1. By RC (4.8.16.53) on

        > You can't fsck an svnd device, which is annoying.

        Actually, you can fsck an svnd device. I just did it on 3.6. Now, being encrypted may be a different matter.

      2. By Otto (82.197.192.49) otto@drijf.net on

        You CAN fsck an (encrypted) svnd file system. The page is wrong.

  3. By Ely (68.229.23.47) on

    This article is not about setting up an encrypted fileserver; it's about adding a hard disk to your system and encrypting it.

    "Now you can go off and, for example, configure Samba to share this volume in a windows-network ..."

    That's all it says about setting up Samba. Not exactly a walkthrough!

    Comments
    1. By sean (139.142.208.98) on

      Since you end up mounting the pseudo devices setting up Samba is trivial (just change mount points).

      I should have pointed out that the intesting part was the encrypting of the drives as the rest is 'run of the mill.'

      Comments
      1. By kokamomi (83.227.181.37) on

        well, i'd say encrypting the disk is the easy part. what's actully making the box a fileserver is the ability to share the contents over a network. setting that up in a secure fashion is much harder, and the suggested use of samba is almost mockery.

  4. By Brian (205.161.1.46) on

    I don't mean to be a dick, but is there really a legitimate reason for running bittorrent off of an encrypted filesystem? Seeing how complicated it is to setup and given the anonymous distribution and unencrypted transfers that make bittorrent, I really cant think of one outside of distributing illegal material (warez, movies, kiddie porn, etc).

    Maybe I'm missing something..?

    Comments
    1. By Anonymous Coward (198.110.83.83) on

      Are you trying to say that people who want to use cryptography must have something to hide?

      Comments
      1. By Brian (205.161.1.46) on

        No, I'm saying that running a bittorrent server off an encrypted filesystem in OpenBSD is pretty pointless unless you're distributing illegal files. Even then, I'd think it would be more of a feel good measure on the part of the server operator than anything else.

        Seriously, why?

        Comments
        1. By Jonas (213.114.206.82) on

          Why not? Protection is always good no matter what you do. Samba, Bittorrent were just examples of applications that can be used to share files.

        2. By Chris (24.76.170.207) on

          You're assuming here that people don't want everything they transfer down the wire encrypted by default.

          This is the same mentality that has people using PGP even though it's moderately more irritating than just sending email. I don't see how it's an irrational one.

          To state this more succinctly: What do I have to hide? Everything! And none of your business!

    2. By RC (4.8.16.53) on

      How about anti-government propoganda? You would want to distribute it, but don't want to be caught with those files on your system.

      It doesn't matter, though. You don't need a life-or-death reason to want encryption... Perhaps you just don't want anyone to be able to recover your files in the event that your hard drive suddenly crashes and you have to send it in. Any reason at all is good enough.

      Comments
      1. By Anonymous Coward (131.202.168.108) on

        Sadly, most governments that suppress anti-government propaganda won't spend much time worrying about whether or not they can prove beyond a doubt that you are distributing something they don't like (by say ... trying to decrypt files on your harddrive). They'll simply smash your computer to bits, and probably have you bayonetted through the back for their trouble.

        Comments
        1. By Anonymous Coward (65.167.23.134) on

          Yeah just yesterday I got bayoneted through the back for saying George W. Bush looks like a monkey. That ruined my day, to be sure.

          Comments
          1. By Anonymous Coward (131.202.168.108) on

            Last I paid attention, most of the USA had not reached 'police-state' status. You must be in Texas?

            Comments
            1. By Anonymous Coward (66.93.216.162) on

              National ID cards passed the House and most likely will pass the Senate within the week. Your papers please? Oh ha we already have to show papers for state-to-state travel via air and bus :(

              Comments
              1. By pat (80.218.139.214) on

                showing papers going from state to state? sounds like europe in the ol'days to me... we survived that one though. but i do get your point. going from some freedom to less is no attractive option, i agree.

  5. By Anonymous Coward (203.13.2.142) on

    Anyone got a mirror of this on a webserver that uses a standard port?

  6. By RC (4.8.16.53) on

    Better make sure your encrypted loopback filesystem is mounted "sync" and softupdates are disabled.

    Comments
    1. By Anonymous Coward (69.197.92.181) on

      Why?

      Comments
      1. By Anonymous Coward (80.135.238.182) on

        This would leave the filesystem more consistent after an unclean unmount.

        Comments
        1. By Anonymous Coward (69.197.92.181) on

          Who cares? How long does it take to fsck? There is no more reason to mount your vnd this way than to mount any other partition this way. Its certainly not something some random person on undeadly can decide for everyone.

          Comments
          1. By Anonymous Coward (80.135.255.241) on

            I'd interpret it as a suggestion. You'd allways have to research the advice you got on a public forum.
            fsck cannot repair all errors. I think less errors to repair are better.
            oh, and fsck'ing e.g. a 300GB partition still takes some time.

        2. By rene (138.217.103.42) on

          "more consistent"? I don't think so. There may be a risk of data-loss if the metadata not being been written to the disk yet, but the actual filesystem should be as consistent as without softupdates, as long as you've mounted sync.

  7. By Sky (159.149.70.77) darksky@despammed.com on

    Link dead

    Comments
    1. By j. (80.108.115.184) on

      Works for me without a problem. What error do you get?

      Comments
      1. By cod3fr3ak (207.87.24.14) on

        Not able to access this link either. I think its the non-standard port thats throwing things awry.

        Comments
        1. By Anonymous Coward (67.34.129.203) on

          It's down. But google has a cached copy:
          http://64.233.179.104/search?q=cache:FEuW8-5qs_cJ:pooh.selwerd.nl:81/index.php%3Fid%3D84+&hl=en&ie=UTF-8

          I don't see anything in there that wasn't already covered in the previously mentioned filesystem encryption HOWTO though (except for the mention of samba, etc.) Was there anything new in there related to encryption? Maybe I missed it...

    2. By Anonymous Coward (212.20.172.166) on

      http://geektechnique.org/index.php?id=84

  8. By Hannes (81.233.16.116) on

    I've read in another howto that you can't do encrypted filesystems larger that 8,8 GB. Is that true? Becaue a fileserver has very often larger disks than that.

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]