Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Dec 2015 21:44:01 -0800
From:      Aleksandr Miroslav <>
Subject:   best practice for locking down private jail?
Message-ID:  <>

Next in thread | Raw E-Mail | Index | Archive | Help
So I'm setting up a server for a friend who wants to upload audio
files and have them served up via http. i.e. He uploads lecture.mp3 to, and wants people to be able to access it via

He's somewhat tech savvy, but I'm being super paranoid about security,
so this is what I did:

- setup a server,, with a public IP, FreeBSD 10.2
- on this server, I setup a jail with a private IP
- setup a pf rdr rule so that goes to
private-ip-of-jail:22, so he can only access the jail via ssh
- inside the jail, I set up sshd to only allow his user (AllowUsers
joeblow), and disabled passwords, so he can only access the machine
with an ssh key
- he will upload his files to his home directory (within the private
jail), and put it in some directory, e.g. ~joeblow/audiofiles
- from the machine, outside the jail, i setup httpd to
serve files only from

I've setup everything but the last step (httpd), and I will get that
last bit working shortly.

For what I want to do, does this look like an okay setup? Is there
anything else I can do to lock this setup down? I figure in the worst
case scenario, someone steals his ssh key and the worst damage they
can do is delete the files he's uploaded (I'm taking backups so not
too worried about that), or upload files to the server that is http
accessible -- can I tell Apache to only serve up mp3 files of name
lecture-num.mp3 or something like that?

Any thoughts or suggestions appreciated.


Want to link to this message? Use this URL: <>