1833473 Members
3488 Online
110052 Solutions
New Discussion

umask for ftp

 
SOLVED
Go to solution
YLTan
Frequent Advisor

umask for ftp


I have ftp enable for users to ftp files to a fix directory (not using anonymous ftp). But I need to fix the file permission to be rwxr--r-- only. How do i ensure this is so for all files that are ftp into this directory??

I kept getting different permission set on the files being put in the directory.
tyl
4 REPLIES 4
T G Manikandan
Honored Contributor

Re: umask for ftp

#umask

what is the value of that?

#umask 022

for the setting the txt files will have

666
(-)022
----------
644 ie. rw-r--r--

FOr dir and exe's

777
(-)022
----------
755 i.e rwxr-xr-x
-----------

Revert
Con O'Kelly
Honored Contributor

Re: umask for ftp

Hi
If you look at man ftpd the default umask is 027. You can change this with the -u option.

Cheers
Con
V.Tamilvanan
Honored Contributor
Solution

Re: umask for ftp

Hi,

Use these steps to set the umask for all FTP login:
a. Modify /etc/inetd.conf and change the line:
ftp stream tcp nowait root /usr/lbin/ftpd ftpd -l
to read:
ftp stream tcp nowait root /usr/lbin/ftpd ftpd -l -u044

b. Have the inted daemon reread the configuration file
by issuing this command:
inetd -c
This will restart the inetd process.

HTH
Adam Vollmar
Occasional Advisor

Re: umask for ftp

Hi,

this could be done with a line in /etc/ftpd/ftpaccess, i.e.:
upload /transfer/input * yes user group 0744

So you can configure different permissions; the -u-option of the ftpd concerns all users.

Regards
Adam