1832880 Members
2263 Online
110048 Solutions
New Discussion

Re: umask issue!!

 
Amit Manna_6
Regular Advisor

umask issue!!

HI All,
I am facing a problem:
One application is generating some text files and one user is putting these files(via ftp) in a directory.

Files that are placed in this folder are not having the read permission for
"others". The user belongs to "others" and they are not able to read these files.

When the ftp files to this location,
UMASK is set to 027. How can we change the UMASK so that files
placed in this folder should have read access to "others".

Required help on this issue.
6 REPLIES 6
Paul_481
Respected Contributor

Re: umask issue!!

Hi Amit,

Try changing the umask of the ftp user via its .profile.

or

vi /etc/inetd.conf

ftp stream tcp nowait root /usr/lbin/ftpd ftpd -l

add -u 007 or the umask that you want

ftp stream tcp nowait root /usr/lbin/ftpd ftpd -l -u 007

regards,
Paul
Amit Manna_6
Regular Advisor

Re: umask issue!!

Thanks for the reply Paul.

As its ftp the .profile will not be exported in this case.
Bill Hassell
Honored Contributor

Re: umask issue!!

As you mentrioned, ftp does not login so any settings in the profiles will never be taken. The -u for ftpd sets the umask value for the files created on the ftp server. Note that you must tell inetd to re-read the /etc/inetd.conf file for the change to take effect. And verify that inetd made the change with:

tail /var/adm/syslog/syslog.log


Bill Hassell, sysadmin
Sanjay_6
Honored Contributor

Re: umask issue!!

Hi Amit,

Is the ftp process controlled by ftpaccess or simple ftp. IF it is controlled by ftpaccess, you can change the file permissions over there.

You can also use the umask command at the ftp command level to change the permission of the file ftp'ed after that. The umask will be applicable for that session only.

ftp some_system
umask 022
put some_file
bye

Hope this helps.

Regds
Amit Manna_6
Regular Advisor

Re: umask issue!!

Bill: If we change the inetd.conf file it will be reflected globally. We want it for the particular user only.

Sanjay: There is no ftpaccess file

So, any other suggestions?

Bill Hassell
Honored Contributor

Re: umask issue!!

There are no user-specific umask settings for inetd.conf--it will change for all file transfers into this server. You'll need to configure the ftpaccess file and include the user into a class which can be specified for the umask option.


Bill Hassell, sysadmin