Questions tagged [jail]

Jails improve on the concept of the traditional chroot environment in several ways. In a traditional chroot environment, processes are only limited in the part of the file system they can access.

One of the tools which can be used to enhance the security of a FreeBSD system is jails.

Jails have been available since FreeBSD 4.X and continue to be enhanced in their usefulness, performance, reliability, and security.

Jails build upon the chroot(2) concept, which is used to change the root directory of a set of processes, creating a safe environment, separate from the rest of the system. Processes created in the chrooted environment can not access files or resources outside of it. For that reason, compromising a service running in a chrooted environment should not allow the attacker to compromise the entire system.

However, a chroot has several limitations. It is suited to easy tasks which do not require much flexibility or complex, advanced features. Over time many ways have been found to escape from a chrooted environment, making it a less than ideal solution for securing services.

Jails improve on the concept of the traditional chroot environment in several ways. In a traditional chroot environment, processes are only limited in the part of the file system they can access. The rest of the system resources, system users, running processes, and the networking subsystem are shared by the chrooted processes and the processes of the host system.

Jails expand this model by virtualizing access to the file system, the set of users, and the networking subsystem. More fine-grained controls are available for tuning the access of a jailed environment. Jails can be considered as a type of operating system-level virtualization.

A jail is characterized by four elements:

A directory subtree: the starting point from which a jail is entered. Once inside the jail, a process is not permitted to escape outside of this subtree.

A hostname: which will be used by the jail.

An IP address: which is assigned to the jail. The IP address of a jail is often an alias address for an existing network interface.

A command: the path name of an executable to run inside the jail. The path is relative to the root directory of the jail environment.

Jails have their own set of users and their own root account which are limited to the jail environment.

The root account of a jail is not allowed to perform operations to the system outside of the associated jail environment.

More:

114 questions
4
votes
3 answers

set up a chrooted SFTP login with OpenSSH

How might I create an SFTP login for an untrusted user in which he can only access the files in his own home directory and not run any commands? The online tutorial OpenSSH SFTP chroot() with ChrootDirectory is almost exactly what I need, except…
Sophie Alpert
  • 1,639
  • 1
  • 13
  • 16
4
votes
2 answers

Migrate FreeBSD jail

I need to create a freebsd jail for web hosting, that will be frequently migrated between hosts. How feasible is it? Can I use domains instead of IPs? can I use wildcard IPs? I need this to benchmark different hw/sw configuration against a known…
Mascarpone
  • 872
  • 3
  • 9
  • 28
4
votes
4 answers

It is fair to jail my SFTP users to their home directory?

roots. I'm running an Ubuntu 9.04 (home) Server on my LAN. I currently use it to store little web apps, photos, some subversion repository and stuff like that. My (few) users are friends of mine and I always provided them with a jailed FTP access to…
tunnuz
  • 427
  • 2
  • 5
  • 10
4
votes
2 answers

How to map authenticated Nginx users to their own directory?

I am writing a social networking site in C and serving it all up with Nginx. How can I make it so that authenticated users go to their own directory -ONLY- where a user-specific index.html resides. I am not asking how to populate the index.html…
DisgruntledUser
  • 101
  • 2
  • 9
4
votes
4 answers

Prevent rssh users from leaving their jail directories

I'm attempting to use rssh to jail users strictly to their /home/user/public_html dirctories. I got it to work where an account can SFTP into the system successfully on a test server, but once I login as that account, I noticed that I can change…
Skittles
  • 421
  • 1
  • 7
  • 16
4
votes
1 answer

Building NanoBSD inside a jail

I'm trying to setup a jail to enable building a NanoBSD image. It's actually a jail on top of a NanoBSD install. The problem I have is that I'm unable to mount the md device in order to do the 'build image' part. Is it simply not possible to mount…
ptomli
  • 181
  • 4
4
votes
3 answers

SFTP access akin to jailed shell

I have a question about creating a user with sort of jailed shell access (actually all is required of this user is an sftp access to one particular directory). Scenario is as follows - I have an existing code which is IonCube protected so I cant…
RandomWhiteTrash
  • 269
  • 1
  • 3
  • 17
4
votes
2 answers

How to tell if a freebsd jail is up to date?

I've set up a "Service Jail" in FreeBSD 8.0 according to the FreeBSD Handbook (http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails-application.html). After upgrading the host to the latest patch level and then performed a jail-upgrade,…
3
votes
0 answers

How to diagnose netstat: no namelist

I had to replace an NIC on my HP Proliant Microserver, running FreeNAS 9.3 In my crashplan jail, I now get "netstat: no namelist" as a response when I execute the netstat command. How to I diagnose this? Could it be that the virtual NIC epair for…
Shawn de Wet
  • 135
  • 4
3
votes
1 answer

Should Postfix run chrooted if it already is in it a FreeBSD jail?

I'm running Postfix together with Dovecot and a few milters in a FreeBSD jail. Is there a significant security gain when I run SMTP and SMTPD daemons chrooted as well?
basbebe
  • 313
  • 2
  • 16
3
votes
1 answer

How do I symlink one directory to a chrooted (jailed) directory?

'm trying to create a folder (directory) for a jailed user on my server that will allow him to access another folder outside of his jail. I'm trying to do this with symlink but all it does is create a file, instead of a folder. He's using FTP and I…
user183479
  • 31
  • 1
  • 2
3
votes
3 answers

Shared authentication across FreeBSD Jails

I am using FreeBSD with ZFS to run several jails. For jail management I'm using ezjail, and I have a template jail which I use for provisioning. I want to share passwd, groups, and authentication information across all jails and the host. For the…
n n
  • 145
  • 5
3
votes
0 answers

Simplest & Easy Way To Jail Users

I Need Simplest & Easy Way To Jail Users in there home directories I am looking tools like " jailkit & MySecureShell " Or simple configuration to jailing users (with full help or some good web links ) i want to give users (ssh + sftp) . 2 services…
One Zero
  • 131
  • 5
3
votes
1 answer

jailkit chroot terminates ssh login

I've done my very best to follow these instructions to create a chroot shell. But the connection get's terminated every time I try to login via ssh for my new chrooted user. I start my ssh terminal, login via chrooteduser and then as soon as I'm…
Emmanuel
  • 347
  • 1
  • 9
  • 20
3
votes
1 answer

What are the security implications of using allow.sysvipc in a FreeBSD jail

The man page for jail says that allow.sysvipc enables "System V primitives [to] share a single namespace across the host and jail environments..." thus "... processes within a jail would be able to communicate with ... processes outside of the jail,…
gvkv
  • 293
  • 3
  • 14