LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   AIX (https://www.linuxquestions.org/questions/aix-43/)
-   -   File transferred by FTP not taking UMASK settings. (https://www.linuxquestions.org/questions/aix-43/file-transferred-by-ftp-not-taking-umask-settings-780505/)

mufy 01-07-2010 04:59 AM

File transferred by FTP not taking UMASK settings.
 
Hi,

UMASK value of an ftp account, TSTFTP, on the destination machine is:

Code:

$ id
uid=231(TSTFTP) gid=14(dba) groups=1(staff)
$ umask
06

File created as TSTFTP user has the following permissions:
Code:

$ touch test.txt
$ ls -ltr | grep test.txt
-rw-rw----  1 TSTFTP  dba              0 Jan 07 13:50 test.txt

But when I ftp a file as TSTFTP, say, ftp.txt from another machine with the following permissions:

Code:

$ls -ltr ftp.txt
-rw-rw-rw-  1 op58    system            0 Jan 07 13:37 ftp.txt

When it reaches the destination, it has the permission as follows eved though the UMASK is 006 as stated above:
Code:

$ ls -ltr ftp.txt
-rw-r-----  1 TSTFTP  dba              0 Jan 07 13:56 ftp.txt

Can someone explain as to why this is happening?

zQUEz 01-07-2010 06:42 AM

what FTP program are you using? I know in vsftpd there is a local_umask setting. Perhaps you have the same and it take precedence.

mufy 01-07-2010 08:39 AM

That's what I figured too when I searched online. Both the boxes use the nattive FTP program in the OS (AIX). I am lost as to where this order of precedence is coming from, if that is what the issue is.

zQUEz 01-07-2010 11:43 AM

I no longer have access to AIX server to place with, however, this looks like the answer to me: http://publib.boulder.ibm.com/infoce...cmds2/ftpd.htm

Search for "-u OctalVal" - that seems to set the umask value.

mufy 01-09-2010 11:20 PM

Thanks to zQUEz's directing me to the relevant resource I was able to resolve the issue.

FTP daemon, by default, has a UMASK value of 027 which gives the files FTPd a permission of rw-r-----. To have this changed to rw-rw----, the following entry in /etc/inet.conf:

Code:

ftp  stream  tcp6    nowait  root    /usr/sbin/ftpd  /usr/sbin/ftpd -l -d
was changed as:
Code:

ftp  stream tcp6  nowait root  /usr/sbin/ftpd  /usr/sbin/ftpd -l -d -u 007
Once that was done, the inetd daemon was refreshed thus:
Code:

refresh -s inetd

ktmariappan 05-22-2014 05:59 AM

setting umask value for ftp in redhat
 
Here ftp's(anonymous) default file permission is,after upload 700(777-077=700). You may wish to change this to 744,Please add below entry to /etc/vsftpd/vsftpd.conf file

anon_umask=033



After changes you should get below permission
drwxr--r-- 2 14 50 4096 May 22 10:40 Thangamariappan


All times are GMT -5. The time now is 12:00 AM.