This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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
2) Go to and get the sourcefile
3) tar xzf openssh-3.5p1.tar.gz
patch -p0 < osshChroot-3.5.diff
cd openssh-3.5p1.tar.gz
./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/sbin
(Be sure to check that configure script, I can't remember the exact
make install
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 ]
mkdir /home/$1
mkdir /home/$1/bin
mkdir /home/$1/home
mkdir /home/$1/usr
mkdir /home/$1/usr/sbin
mkdir /home/$1/tmp
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
experience! =)
"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:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]