Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

UPDATE:

I never did get this figured out. Instead i ended up jsut using jailkit since there is a ton (though sometimes outdated) documentation on usage. Id still be interested in knowning how to get schroot to work though.


IVe found a ton of documentation on setting up schroot/debootstrap as well as a ton of stuff on jailing sftp and some modest instructions for creating a chrooted shell but i cant find anything on get this all working cohesively. Seems like most tutorials are geared towards creating in isolated build environment which is not what i need.

I have schroot set up with an env at /srv/chroot/systemid. That works well i can initiate a session fine with schroot -c systemid -u somejaileduser.

What i cant seem to get to work properly is chrooting an ssh session. My current configuration looks like this:

Match Group jail
   ChrootDirectory /srv/chroot/systemid
   # other stuff to out law tcpforwarding and what not

This kind of works in that i get a chrooted ssh session, but it dumps me directly in the chroot as the working directory. I think this is because a session is never actually kicked off and so /home never gets bound to /srv/chroot/systemid/home (if do ls /home in the ssh session its empty).

So are the configuration steps im missing here?

share|improve this question

2 Answers 2

I'm wondering in many of these cases that instead of jailing each user account, is simply to provide each user with a small virtual machine on the host.

Seems like collecting all the files necessary to have a workable chroot jail on a per user basis is problematic, easily subject to problems and very complex.

share|improve this answer
    
Actually, getting all the files installed is easy using debootstrap.. it does a mini install of an OS in the chroot, and i dont think the problem is missing libs - i thnk the problem is a missing setting somewhere to kick off the schroot session. –  prodigitalson Feb 13 '13 at 6:30

sshd_config has variables you can use with ChrootDirectory.

Match Group jail
   # %u is replaced by the username, %h is the full home path
   ChrootDirectory /srv/chroot/systemid/%u
   #ChrootDirectory %h
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.