Click to See Complete Forum and Search --> : Permission of FTPed Files


Michael Luton
09-24-2001, 03:20 PM
I'm sure this question is so easy it's ridiculous but I can't seem to find a solution on my own so here goes.

I'm using Red Hat 6.2 and whatever the default FTP server is that comes with it. I have 'umask 002' at the end of my .bash_profile. When I create files in the shell they of course have the correct permission (664). The most important being that they're group writtable. However, when I upload anything via FTP the permissions are 644 and thus lacking the group writtable trait.

So my question is this. How do you set the default file permission for files created via an FTP upload?

-- Michael Luton

slacker_x
09-24-2001, 05:19 PM
I can't answer your question, but I can tell you that it doesn't really make sense.

A umask of 002 would mean files would be created with permissions 775

stiles
09-24-2001, 06:48 PM
Originally posted by slacker_x:
<STRONG>A umask of 002 would mean files would be created with permissions 775</STRONG>

That's incorrect, a directory will have a mode of 775 with a umask of 002, a file will have a mode of 664. Here's the rules for files, you start with 666 and subtract the umask, but you can never have the execute bit set at creation time. If the mode tries to set the x bit it is rounded up. Try umask 015 and touch a file to see what the mask is.

Most people know what the mask repersents with files, but for directories here's the meanings:

4 r gives the user permission to list the contents of the directory

2 w can create and remove files even if the files don't belong to them

1 x alows a user to make the directory their current directory (can access the files)

to the point of the question, either the FTP server your using has a parameter to set it's umask or it uses the umask of the user the daemon is running as. I think the default FTP server is WU-FTPD. In other words I don't know.