08-06-2002
133,
0
Join Date: Apr 2002
Last Activity: 10 July 2013, 10:52 AM EDT
Location: Argentine
Posts: 133
Thanks Given: 0
Thanked 0 Times in 0 Posts
From: Timothy Carey
After doing a little more research, I answered my own question. For
those interested, here's how to do it:
1) Download and install ssh from ssh.com with the following option
./configure --enable-static
make ; make install.. blah blah
2)cd into the account you want to be chrooted and do the following:
> mkdir bin
> cd bin
> cp /usr/local/bin/ssh-dummy-shell.static .
> cp /usr/local/bin/sftp-server2.static .
> ln -s ssh-dummy-shell.static ssh-dummy-shell
> ln -s sftp-server2.static sftp-server
3) Configure sshd2_config by adding the following line:
ChRootUsers user1,user2
-or-
ChRootGroups group1,group2
4) Change the chrooted users shell to /bin/ssh-dummy-shell in
/etc/passwd (NO.. not /usr/local/bin/ssh-dummy-shell.. just use
/bin/ssh-dummy-shell)
Fire up sshd, and you should be all set..
-Tim