Operating System - HP-UX
1837791 Members
3189 Online
110120 Solutions
New Discussion

Restricted FTP unable to view file by ls

 
SOLVED
Go to solution
Farida Rajkotwala
Occasional Contributor

Restricted FTP unable to view file by ls

hello!
I was wondering if someone can guide to
enable restricted ftp on my system.
So that the users can not look at the listing
by ls, they can get the files that they
know exist.

Thanks,
Farida
Doing something imperfectly is better than doing perfectly nothing
2 REPLIES 2
Steven Sim Kok Leong
Honored Contributor
Solution

Re: Restricted FTP unable to view file by ls

Hi,

To disallow a FTP user from viewing a file by ls, simply chmod 111 (ie. d--x--x--x) the FTP directory so that the user can only cd to the FTP directory but not read the contents of the directory via ls (which requires permissions 555).

For the files residing in the FTP directory itself, they must have at least the permission 444 (ie. -r--r--r--) in order to allow the download (ie get) to work.

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
Rita C Workman
Honored Contributor

Re: Restricted FTP unable to view file by ls

I'm not sure I understand what your trying to do.
If your meaning your restricted ftp users are not able to do an ls to list the files...then that is probably because you copies /usr/bin/ls over to their directory and you should have copies /sbin/ls like this:

cp /usr/sbin/pwd /home//bin
cp /sbin/ls /home//bin

Than did a chmod 0111 /home//bin/*

...Now if what your meaning is that your trying to control your ftp users from moving around and seeing other things than you probably want to do a chroot...take a look at this thread:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x05970559ff7cd4118fef0090279cd0f9,00.html

/rcw