Marcus,
The problem lies in your understanding of Unix (and therefore,
Linux) file permissions. When applied to a file which is a directory, the
'x' permission actually means 'search'. Thus for all subdirectories in
'pub', you have read permission, but do not have 'search' permission.
What does this imply? What 'search' means is that if you have read
access to the directory, you may read its contents, however, you cannot
read the inodes of the files listed in the directory. 'ls <filename>'
produces its output from the contents of the parent directory, but 'ls
<filename>' has to read the inode of <filename> to produce its output.
Thus, 'ls -l /public/ftp' will show you the existence of the pub
directory, and information stored about it in the directory /public/ftp.
'ls /public/ftp/pub' will show you the contents of the pub directory.
But, IF YOU ARE NOT ROOT, 'ls -l /public/ftp/pub' will always fail with an
access error.
This is why 'cd' fails. When doing a 'cd' the attributes of the
current directory in the u-area need to be replaced with the attributes of
the new current directory. For this, the inode of the new directory needs
to be read. Since the permissions disallow it, the 'cd' command fails.
NOTE : Under linux, 'ls /public/ftp/pub' seems to list out the contents of
pub, but also appears to try and read the contents of the inodes of the
files in the directory - thereby producing an access error. This surprises
me as I was under the impression that 'ls' without arguments does not try
and acquire the inodes. Can anyone enlighten me?
Kenneth
There is no such thing as luck. 'Luck' is nothing but an absence of bad luck.
On Fri, 20 Nov 1998, Marcus Cole wrote:
> Hi listers,
>
> I have been having a bit of trouble configuring anonymous ftp on my
> Debian 2.0 box. I have set all the parameters according to man ftpd (as
> least as I can tell), yet when I ftp to the machine, I can't see any
> directory structure. When I try to cd into the subdirectories
> permission is denied, except for going into the /pub directory. I have
> placed a file into the ftp directory from an NT machine,but the file
> still didn't appear to the NT FTP program.
>
> Any tips you could give me would be appreciated.
>
> Marcus
>
> config info follows....
>
> dir structure:
> /public/ftp (this is the root directory for the ftp user name)
> /bin (contains a copy of ls)
> /etc (contains a copy of passwd and group)
> /pub (contains incoming and outgoing dirs)
>
> ownerships and permissions:
> dr-xr-xr-x 5 ftp root ... ftp
> dr-xr-xr-x 2 root root ... bin
> ---x--x--x 1 root root ... ls
> dr-xr-xr-x 2 root root ... etc
> -r--r--r-- 1 root root ... group
> -r--r--r-- 1 root root ... passwd
> drwxrwxrwx 5 ftp root ... pub
> drw-rw-rw- 2 ftp root ... incoming
> dr--r--r-- 2 ftp root ... outgoing
>
> passwd file info:
> ftp:x:100:50::/public/ftp:/bin/false
>
>
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
>