Questions tagged [jail]

"The FreeBSD jail mechanism is an implementation of operating system-level virtualization that allows administrators to partition a FreeBSD-based computer system into several independent mini-systems called jails." source: Wikipedia

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. Traditional security issues which plagued the original chroot(2) design will not affect FreeBSD jails.

  • A hostname -- the hostname which will be used within the jail. Jails are mainly used for hosting network services, therefore having a descriptive hostname for each jail can really help the system administrator.

  • An IP address -- this will be assigned to the jail and cannot be changed in any way during the jail's life span. The IP address of a jail is usually an alias address for an existing network interface, but this is not strictly necessary.

  • A command -- the path name of an executable to run inside the jail. This is relative to the root directory of the jail environment, and may vary a lot, depending on the type of the specific jail environment.

source: https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html#jails-synopsis

Links

75 questions
1
vote
1 answer

Instantiating BSD jails from C

I have been trying to be able to create BSD jails from an application. Based on the FreeBSD man pages for jail(2) I've come up with: struct jail _jail; _jail->version = ; _jail->path = "/some/path/"; _jail->hostname =…
Christian Grabowski
  • 2,334
  • 2
  • 23
  • 53
1
vote
1 answer

How do I prevent an include of files out of system directories?

I have to prevent the #include of any files out of system directories because of security reasons. Is there any restrictions that can prevent #include<...> and #include"..."from including unsafe files like #include or #include…
Fissure Blue
  • 131
  • 7
1
vote
1 answer

Ezjail and /etc/jail.conf in FreeBSD 10.2

I have a question regarding the following warning when using Ezjail-3.4.1 on FreeBSD 10.2 /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* var "enter code here" iables is obsolete. Please consider to migrate to /etc/jail.conf "enter code…
Mr.hill
  • 11
  • 4
1
vote
3 answers

FreeBSD Jail and SSH - /dev/tty: No such file or directory

When I try to connect through SSH from inside the JAIL I get this error: # ssh test@test.com ... debug1: read_passphrase: can not open / dev / tty: No such file or directory Host key verification failed. Outside JAIL everythng is working properly.…
Maciej Kucharz
  • 1,163
  • 1
  • 10
  • 17
1
vote
1 answer

PHP, Apache and MySQL on FreeBSD jail

I am trying PHP, Apache, MySQL stack on FreeBSD. I created two jails in one FreeBSD host. I installed PHP, Apache in one jail and MySQL Server in another. All these components working fine in their own jail. My target is to host a PHP application…
ASDF
  • 109
  • 1
  • 9
1
vote
2 answers

Managing FreeBSD Jails programmatically

Is it possible to manage the FreeBSD jails programmatically (create jails, perform snapshots, etc)? I know there is a libjail, but I couldn't find any examples.
Nedo
  • 579
  • 1
  • 9
  • 18
1
vote
0 answers

Git server in jail: working directory in different jail

I'm setting up a FreeBSD server with five jails. some of them are web server with web apps. Some of those apps should be updated using git. I was now thinking about running the git server in his own jail. But would there be any way to keep the git…
basbebe
  • 517
  • 1
  • 8
  • 25
1
vote
2 answers

Move a Sftp User in a Subdirectory of his Jail

I've a question concerning the Jail explained later: User to be jailed: foo Jail Directory: /mnt/foo-jail Home directory of foo: /mnt/foo-jail/foo-home Everything is ok. Jail is up and the user is connecting correctly. The problem is: "foo" has…
Echoes_86
  • 253
  • 3
  • 7
1
vote
2 answers

How to chroot Django

Can one run Django in a chroot? Notably, what's necessary in order to set up (for example) /var/www as a chroot'd directory and then have Django run in that chroot'd directory? Thank you - I'm grateful for any input.
Brian M. Hunt
  • 71,376
  • 65
  • 208
  • 328
1
vote
2 answers

Create a Chroot Jail and copy all system files into jail

I am creating chroot jail in linux , but i do not have access to any system file like ls/cd/gcc/g++. What are the necessary libs/bin/systme files i need to copy to my chroot jail ?
user1159517
  • 3,374
  • 6
  • 24
  • 42
1
vote
1 answer

Mosh via two-level ssh (FreeBSD, jails)

I am fond of mosh but I have problem connecting via two-level ssh. Consider this scenario: host machine running FreeBSD which has closed all ports from outside first jail having ssh port 2222 open from the outside is on public IP let's say…
geronime
  • 533
  • 3
  • 15
1
vote
0 answers

Time in the FreeBSD jail is "jumping" every hour

I can't resolve my problem with time in FreeBSD JAIL :( I have set my timezone correctly. And I have commented this line: #1,31 0-5 * * * root adjkerntz -a Here is my cron log: Feb 3 12:15:00 blahblah…
Vladimir
  • 11
  • 1
1
vote
2 answers

freebsd9 jail can not start jails

I'm trying to start jail in FreeBSD 9 configs: etc/rc.conf: #jails: jail_enable="YES" jail_interface="re0" jail_devfs_enable="YES" jail_procfs_enable="YES" jail_set_hostname_allow="YES" jail_list="test" ifconfig_em0_alias0="inet…
Vlad
  • 63
  • 9
1
vote
0 answers

Man-in-the-middle: Intercepting an applications function/library calls

Basically, what I want to achieve is to run a program in an environment which will give any value asked by the program on basis criteria decided by me. Say e.g., games regularly query system about the time so as to execute animations, now if I have…
pareshverma91
  • 796
  • 1
  • 7
  • 14
0
votes
1 answer

jQuery Asynchronous Image Loader Woes

Using jQuery JAIL (jQuery Asynchronous Image Loader) in my site, I've followed all the instructions correctly but for some reason, the images always load first before the plugin takes place... I have it set up so that the images should fadeIn after…
Paul
  • 1