I have setup a jail on FreeBSD-8.2 following the manual. After the setup, I copied these files rc.conf, /etc/passwd from base to jail. And this is what I did in order:

  1. jexec id passwd (to change the jail root password)
  2. jexec id adduser (i added a user as a non-root)

Why can't I login to the jail through ssh? but I can login with "jexec id login"? I mean I can connect to the jail but it fails to authenticate?

And why can't I execute any commands like rehash/ping/ps when I'm inside my jail? Which files do I still need to copy from the base?

  • 1
    Until you're more familiar with jails and their requirements you should probably just install a full base in each jail so you know it will run. Once you've got that down then start cutting back on what gets installed.
    – Chris S
    Nov 14, 2011 at 15:55

1 Answer 1


By default, in the base system, ssh will listen on all interfaces, port 22.
In a default jail install, sshd will listen on all interfaces (specified in your jailed rc.conf), port 22.
Since the base system sshd is already listening on these addresses the jailed sshd won't be able to bind to them.

What this means in practical terms is that when you are trying to connect to your jail via ssh with the new jail-only user you are in fact trying to connect to the base system (which doesn't know about that user).

As for the second question, ping/ps should be installed in the DESTDIR you specified with make installworld.
Make sure you have a /bin/ps in your jail.

If you need more help try posting more information, such as the commands you ran (start to finish) to get to this point...

  • Okay.. i edited my sshd_config of my jail and added ListenAddress to the jail's IP. I changed my ssh port to other port actually for added security. Do i need to add that port to jail's sshd_config also? plus when i try to run sshd/etc. this is what i get: ps: /boot/kernel/kernel.
    – jmc
    Nov 15, 2011 at 9:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .