Sunday, October 3, 2010

Changing UMASK for an ftp user account

UMASK is used to set the default permissions of a newly created file.

This value is defined as a system wide property in the /etc/profiles file. By default this value is set as 022.
For each user, this value can be set in their ~/.profiles file there by setting their own customized values.

To calculate permissions which will result from specific umask values, subtract the umask from 777. 
For files, the subtraction is done from 666 and for directories, 777 is used. If umask is 022, this will cause files to be created with permissions of 644 (rw-r--r--) and directories to be created with permissions of 755 (rwxr-xr-x).

So to set this umask value for a ftp user to 006 - GLOBALLY

1. Edit the file /etc/inetd.conf and change the umask value as below

$vi /etc/inetd.conf

EDIT==> ftp          stream tcp6 nowait root /usr/lbin/ftpd     ftpd -l -u 006

2. Save and reinitialize the daemon.

****Do not restart the inetd daemon*** Instead use the below command to re-initialize.

$inetd -c


No comments:

Post a Comment