Re: sftp ssh chroot

2002-12-12 Thread Jeremy Hein
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
   openssh-3.5p1.tar.gz.
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
   command.)
   make
   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.

#!/bin/sh
# add a caged ssh user
# usage sshuser username
# make a directory according to the username
if [ $1 ]
then
	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"
else
	echo "Usage sshuser username"
fi

6) Modify the users directory in /etc/passwd file to be
   home/username/./home
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:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



sftp ssh chroot

2002-12-11 Thread Jeremy Hein
Hi,

Anyone know how to set up a jail for sftp? I've followed the howto at
http://sources.redhat.com/ml/cygwin/2002-07/msg02070.html but when I 
attempt to sftp login, the client freezes after I enter my password. The 
standard ssh login works well keeping me boxed in like it's supposed to. 
 I was able to patch the code on my linux desktop at home to box in 
sftp clients and I want to know if there's a process for cygwin.

Thanks,
Jeremy Hein
--
"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
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/