Operating System - Linux
1752587 Members
3965 Online
108788 Solutions
New Discussion юеВ

ftp ls not working with wuftpd and ftpaccess

 
SOLVED
Go to solution
mark vosberg
Advisor

ftp ls not working with wuftpd and ftpaccess

I already have the solution for this. Well known to wuftpd users but I thought I would post the hpux solution since it was not listed on this forum. The step4 for wuftpd setup

ftp daemon wuftpd-2.6.1 PA-risc hpux11.23
I setup a restricted user in ftpaccess. The ftp user was unable to list his directory with ls.

To list dirs ftpd calls /usr/bin/ls. Well you have been chroot to your home dir so you cannot execute a cmd out of your home dir. So for ftpuser it was looking for /home/ftpuser/usr/bin/ls. In my home dir I created usr/bin and cp ls to it. Then problems with missing libs because ls uses shared libs from /usr/lib. Well I did this.

(tst_serv)cd /home/ftpuser
(tst_serv)ldd /usr/bin/ls #This gave me the 4 libs ls uses.
(tst_serv)mkdir usr
(tst_serv)cd usr; mkdir bin; mkdir lib

(tst_serv)ftpuser> pwd
/home/ftpuser
cp each of the libs to your local lib. this is the end result.
(tst_serv)ftpuser> ll -d usr
dr-xr-xr-x 4 bin bin 96 Apr 11 12:21 usr
(tst_serv)ftpuser> ll usr
total 0
dr-xr-xr-x 2 bin bin 96 Apr 11 12:19 bin
dr-xr-xr-x 2 bin bin 96 Apr 11 12:26 lib
(tst_serv)ftpuser> ll usr/bin
total 96
-r-xr-xr-x 1 bin bin 45056 Aug 26 2004 ls
(tst_serv)ftpuser> ll usr/lib
total 5440
-r-xr-xr-x 1 bin bin 274432 Nov 29 2006 dld.sl
-r-xr-xr-x 1 bin bin 1945600 Jul 28 2006 libc.2
-r-xr-xr-x 1 bin bin 24576 Mar 23 2006 libdld.2
-r-xr-xr-x 1 bin bin 528384 Aug 26 2004 libxcurses.1

Now ls works fine.
Some people have a static compiled version of ls and just copy that to usr/bin. ftp client on windows works because it uses NLST instead of LIST.
4 REPLIES 4
Steven Schweda
Honored Contributor
Solution

Re: ftp ls not working with wuftpd and ftpaccess

> [...] I thought I would post the hpux
> solution since it was not listed on this
> forum. [...]

Because it's a Linux forum?

> Some people have a static compiled version
> of ls [...]

On HP-UX, /sbin is a good place to seek
things like that.

dy # ls -l /sbin/ls /usr/bin/ls
-r-xr-xr-x 1 bin bin 294912 May 5 2003 /sbin/ls
-r-xr-xr-x 7 bin bin 28672 May 5 2003 /usr/bin/ls

If it's that much bigger, it had better be
good for something.
mark vosberg
Advisor

Re: ftp ls not working with wuftpd and ftpaccess

Ah yes /sbin does have the static lib versions. SO just copying /sbin/ls to homedir/usr/bin works just fine without any shared libs. Thank you.
mark vosberg
Advisor

Re: ftp ls not working with wuftpd and ftpaccess

Closing thread
Steven Schweda
Honored Contributor

Re: ftp ls not working with wuftpd and ftpaccess

If you wish to enable some more exotic
features, like, say, on-the-fly gzip
compression, then you may still need to erect
the whole run-time infrastructure to go with
whatever you put into your local "/bin"
and/or "/usr/bin".

On the bright side, if you have a bunch of
near-by guest or other chrooted directory
trees, you can get one set up, and then
construct the others with hard links to those
files instead of wasting space on actual
copies of all of them.