[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ftp trouble - cannot chroot



On Wed, Aug 25, 1999 at 12:24:14PM +1000, Shao Zhang wrote
> Hi,
> 	I am having some trouble to chroot all the users when they ftp.
> 
> 	Using the standard in.ftpd from netstd package, I created a file
> 	/etc/ftpchroot with one line: shao.
> 
> 	But when I ftp as shao, I can log in properly, but "ls" shows up
> 	nothing.
> 
> 	I then tried to use wu-ftpd-academ. Changed passwd entry to 
> 	shao:x:1000:1000:Shao Zhang,,,:/home/shao/./:/bin/bash
> 
> 	add an entry to /etc/wu-ftpd-academ/ftpaccess:
> 	guestgroup 1000
> 
> 	change the entry in /etc/inetd.conf to something like
> 	/usr/sbin/ftpd -a which will enable ftpaccess for wu-ftp
> 
> 	With this config, user can still chdir to anywhere. If I change
> 	it to guestgroup shao, then "ls" shows up nothing again.
> 
> 	Here is what's happening:
> 
> 	230 User shao logged in.
> 	Remote system type is UNIX.
> 	Using binary mode to transfer files.
> 	ftp> ls
> 	200 PORT command successful.
> 	150 Opening ASCII mode data connection for '/bin/ls'.
> 	226 Transfer complete.
> 	ftp> 
> 
> 	Can anyone please help me? I have got this working before but
> 	now I forgot.
> 	

As someone else mentioned, proftpd avoids this problem.

I believe that what has happened to you is that you are operating in a
chroot'd environment and that in that environment there is no /bin/ls to
run, so no directory appears.  Try cd'ing to ftp's home directory and
copying bin/* to /home/shao/bin/ and lib/* to /home/shao/lib/.  This
isn't necessary with proftpd because it has a built-in 'ls'.


John P.
-- 
huiac@camtech.net.au
john@huiac.apana.org.au
"Oh - I - you know - my job is to fear everything." - Bill Gates in Denmark


Reply to: