Operating System - HP-UX
1825010 Members
3777 Online
109678 Solutions
New Discussion юеВ

ftp and "ls -l" command question

 
Mauro Gatti
Valued Contributor

ftp and "ls -l" command question

Hi all,

Usually during a ftp connection command "ls -l" works showing "long" file infos.
But if I use an user limited by ftpaccess "ls -l" don't show anything and "ls" shows only filename.

This is my ftpaccess:

virgo# cat /etc/ftpd/ftpaccess
class local real,guest,anonymous *.domain 0.0.0.0
class remote real,guest,anonymous *
guestgroup ftponly
upload /oradata/ITSMS/utl_file * no
upload /oradata/ITSMS/utl_file / yes utluser ftponly 0666
upload /home/guest * no
upload /home/guest /tmp yes guest guest 0640
upload /oradata/DSS/export/mainftp * no
upload /oradata/DSS/export/mainftp / yes oracle dba 0644
upload /oradata/DSS/export/mainftp /test yes oracle dba 0644

virgo# grep utluser /etc/passwd
utluser:xxxxxxxxxxxxxxx:504:105:,,,:/oradata/ITSMS/utl_file:/usr/bin/false

Is it possible to use "ls -l" or tho view file size from this account?

Thank You

Mauro
Ubi maior, minor cessat!
5 REPLIES 5
Jose Mosquera
Honored Contributor

Re: ftp and "ls -l" command question

Hi,

Do this:

#cd
#mkdir -m 555 -p usr/bin
#cp -p /usr/bin/ls usr/bin
#chown -R root:sys usr/

And try again.

Rgds.
Mauro Gatti
Valued Contributor

Re: ftp and "ls -l" command question

I make changes you suggested but I'm still not able to show ls -l output:

ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for file list.
bonifici.in
usr
bdsesiti.in
bdsoutDL.in
bonifici.log
isvap.log
226 Transfer complete.
ftp: 69 bytes received in 0,00secondi 69000,00Kbyte/sec)
ftp> ls -l
200 PORT command successful.
150 Opening ASCII mode data connection for /usr/bin/ls.
226 Transfer complete.

Ubi maior, minor cessat!
Mauro Gatti
Valued Contributor

Re: ftp and "ls -l" command question

Ok Guys, following ideas given me by Jose Maria I solved my problem.
Because user is "chrooted" it needs to create thi structure under user $HOME:

virgo# ls -la usr/*

usr/bin:
total 64
dr-xr-xr-x 2 root sys 96 Jul 20 10:25 .
drwxr-xr-x 4 root sys 96 Jul 20 11:02 ..
-r-xr-xr-x 1 root sys 28672 May 5 2003 ls

usr/lib:
total 4432
dr-xr-xr-x 2 root sys 96 Jul 20 11:05 .
drwxr-xr-x 4 root sys 96 Jul 20 11:02 ..
-r-xr-xr-x 1 bin bin 188416 Jul 17 2002 dld.sl
-r-xr-xr-x 1 bin bin 1814528 Jan 28 10:28 libc.2
-r-xr-xr-x 1 bin bin 233472 Nov 14 2000 libcurses.1
-r-xr-xr-x 1 bin bin 24576 Jul 17 2002 libdld.2


now "ls -l" and also "dir" commands work fine.

Thank You
Ubi maior, minor cessat!
Rita C Workman
Honored Contributor

Re: ftp and "ls -l" command question

Hi Mauro,

If you're doing restricted ftp, it is generally best to copy /sbin/ls and not /usr/bin/ls to the end-users $HOME directory. Do a quick ls on these two, and you will see there is a difference.
Another thing you might copy to the end-users $HOME directory is /usr/bin/pwd ( yes that one take from /usr/bin ).

Rgrds,
Rita
Jose Mosquera
Honored Contributor

Re: ftp and "ls -l" command question

Pleasant of helping you!

Rgds.