# Minimum Jail - How is that even possible ?



## bryn1u (Mar 19, 2014)

Hi,

I've found free shell server accounts and I was wondering, how has someone done that. 

Look:

```
[bryn1u@shell ~]$ ls /
bin     dev     etc     home    lib     libexec sbin    tmp     users   usr     var
```
Only few configuration files ?

```
[bryn1u@shell ~]$ ls /etc/
csh.cshrc       group           localtime       profile         protocols       pwd.db          resolv.conf     services        termcap
```
Where are rest users ?

```
[bryn1u@shell /etc]$ cat group
users:*:2000:
[bryn1u@shell /etc]$
```
/etc/passwd doesn't exist ?

```
[bryn1u@shell /etc]$ cat /etc/passwd
cat: /etc/passwd: No such file or directory
[bryn1u@shell /etc]$
```
uname -a

```
[bryn1u@shell /]$ uname -a
FreeBSD 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255967M: Tue Oct  1 09:34:22 MDT 2013     root@shell.cjb.net:/usr/obj/usr/src/sys/CJB  amd64
```

Someone can tell me how can I "build" that jail ?


----------



## SirDice (Mar 19, 2014)

It's probably done using the ChrootDirectory option in sshd_config(5). I'm guessing it's been done similar to this: http://therub.org/2011/08/24/minimal-ss ... n-freebsd/


----------



## bryn1u (Mar 19, 2014)

Hey,

Thanks for your reply. Is that possible to do with jail ?


----------



## SirDice (Mar 19, 2014)

bryn1u said:
			
		

> Thanks for your reply. Is that possible to do with jail ?


It doesn't need a jail to function but you should be able to configure your jail's sshd(8) like this. A chroot(8) within a jail(8) should be possible. Never tried it myself though.


----------

