Hot answers tagged


As Kassandry said, you can't do this with a command within the jail itself. What you could do, however, would be to create a separate user (who I will henceforth call closer on the host system. This user should be blocked so that it can only log in with an SSH key. Your jailed user should have the private key and the password for the key. On the host ...


Jail is already a chrooted environment so you can't gain more benefits chrooting jailed software.


Jails specifically forbid the shutdown commands, per the manual page here. Normal machine shutdown commands, such as halt(8), reboot(8), and shutdown(8), cannot be used successfully within the jail. Additionally quoting from The Design and Implementation of the FreeBSD Operating System, Processes running within a jail are not permitted to perform ...


After some more testing the pf rules, I briefly let all traffic pass and realized the mistake was that while I had pass quick on lo0 all in the pf.conf, the jail is running under lo1. I added pass quick on lo1 all and it works now. Also note that from within a jail, you should query the jail IP instead of localhost. So, in the jails resolv.conf: ...


You probably need to add to the jail, as jails will forbid binding to anything but the jail ip. But, if you want to confine mongo just to the jail, maybe a better idea would be to firewall it ... using in jail could be wrong from security point of view.


There are multiple ways to setup chroot jails. Personally I've seen over 50 different scripts for that. All jails are similar, but have smaller or bigger differences, so there is no generic way to do anything inside them. The most common usage of chroot jails regarding installing software, is installing everything from source. Sometimes chroot jails are ...

Only top voted, non community-wiki answers of a minimum length are eligible