Check this out. Might lead you in the right direction. Chrooting ssh is a pain to do. And even harder to do it right.
http://www.aarongifford.com/computers/chrsh.html
-----Original Message-----
From: sektorNBA [mailto:***@sektornba.org]
Sent: Sunday, January 19, 2003 3:17 PM
To: Telent
Cc: ***@openbsd.org
Subject: Re: chroot ssh users
I did this and it works.
but user got root powers.
They can kill root´s process
I just need to LOCK USERS on their OWN home.
not create an JAIL structure.
Thanks
----- Original Message -----
From: "Telent" <***@mordac.info>
To: "sektorNBA" <***@sektornba.org>
Cc: <***@openbsd.org>
Sent: Saturday, January 18, 2003 10:35 PM
Subject: Re: chroot ssh users
Post by TelentOpenBSD 3.1 March 16, 1991
Well, first of all, you said you were running 3.2. But I'll let it
pass...
I don´t undestand it!
could u give an example?
Assuming that I really wanted to go about chrooting a user, I'd set up
a small shell script in /usr/bin. Call it /usr/bin/chrootlogin.
#!/bin/sh
/usr/bin/sudo /usr/sbin/chroot $HOME /bin/csh
Replace csh with your shell of choice, of course.
Now, make a group called chroot. Add all the users who will be
chrooted into it. Now, you need to add a permission declaration line
%chroot ALL = NOPASSWD: /usr/sbin/chroot
Then, you'll need to add whatever utilities you want your shell users
to have into a directory called bin in their home dirs. Don't forget
the things like ls and pwd and cd and echo, the stuff that you use
every day, as well as their shell of choice.
Then, add your users. Put them in the "chroot" group, as well as
their personal groups. Set /usr/bin/chrootlogin as their shell. Make
sure to add that to /etc/shells if you want them to have ftp access.
And that's how you go about setting up a basic chroot environment on
3.2 or 3.1.
3.2-current has lots more features in it that make things easier.
But IMHO, you'd be better served by keeping the box patched. chroots
look pretty, but for users, they're more trouble than they're worth.
If you don't want them reading each other's files, set a umask of 600
or some such.
-Sunny Raspet