I'm setting up an sshd jail for some users on my system (archlinux). Without going into great detail I'd like to keep the scope of the question minimal.
Setting /etc/ssh/sshd_config
:
Match group jaileduser
ChrootDirectory /var/jailedusers
X11Forwarding no
AllowTcpForwarding no
and a system /etc/password
entry similar to:
testuser1:x:2001:2000::/home/testuser1:/bin/bash
So the question is: Is the home directory of /home/testuser1
relative to the sshd_config
entry /var/jailedusers
i.e. should the passwd entry be /var/jailedusers/home/testuser1
or /home/testuser1
with a directory in /var/jailedusers
of /home/testuser1
- AND is the shell in the same boat - is the passwd entry /var/jailedusers/bin/bash
or simply /bin/bash
.
Lastly upon login is the system /etc/passwd
read or is /var/jailedusers/etc/passwd
read as per sshd_config
entry.