This is the mail archive of the
mailing list for the Cygwin project.
Re: sftp ssh chroot
- From: Jeremy Hein <jeremyh at sohowireless dot com>
- To: cygwin at cygwin dot com, jeremyh at sohowireless dot com
- Date: Thu, 12 Dec 2002 09:43:29 -0500
- Subject: Re: sftp ssh chroot
I solved my problem regarding "jailing" users in cygwin. If anyone is
interested, the patch for linux works fine for cygwin. Here are the steps:
1) Download http://chrootssh.sourceforge.net/patches/osshChroot-3.5.diff
2) Go to http://www.openssh.org/portable.html and get the sourcefile
3) tar xzf openssh-3.5p1.tar.gz
patch -p0 < osshChroot-3.5.diff
./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/sbin
(Be sure to check that configure script, I can't remember the exact
4) Now run ssh-host-config -y or however you would normally set it up.
5) Create a user with the shell script I wrote, or write your own.
# add a caged ssh user
# usage sshuser username
# make a directory according to the username
if [ $1 ]
cp /bin/bash /home/$1/bin
cp /bin/cp /home/$1/bin
cp /bin/cygwin1.dll /home/$1/bin
cp /bin/rm /home/$1/bin
cp /bin/mv /home/$1/bin
cp /bin/ls /home/$1/bin
cp /bin/cygcrypto.dll /home/$1/bin
cp /usr/sbin/sftp-server /home/$1/usr/sbin
echo "Remember to change /home/$1 to"
echo "/home/$1/./home in /etc/passwd"
echo "Usage sshuser username"
6) Modify the users directory in /etc/passwd file to be
7) Hope this helps, and sorry if someone already posted this although I
wish I had seen it if they had cause it would have saved me a lot of
trouble, although trouble can be a good thing when it's a learning
"Nothing would please me more than being able to
hire ten programmers and deluge the hobby market
with good software." -- Bill Gates 1976
We are still waiting ....
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html