From Wiki-UX.info

Wiki-UX / File Transfer Protocol / How to change default umask for ftp upload files
Jump to: navigation, search

How to change default umask for ftp upload files

Abstract

This article explains how to configure HP-UX 11i Operating Environment FTP Server to a custom default umask for upload file.

Contents


Background

Most FTP deployments default to 640 permission umask when uploading files to effectively prevent world wide users to be able to access someone else files. Nonetheless, sometimes it may be necessary for to share this information with any other user on the system.

Procedure

This procedure explains how to setup the permission umask for a specific user and directory.

In the following example, how to accomplish this for a user account named user1 and a default directory called /home/user1/subdir is explain.

1. Add the upload line to /etc/ftpd/ftpaccess configuration file.

upload /home/user1 /home/user1/subdir yes user1 users 0666 dirs

To prevent "Access denied" errors, make sure you have at least the class entry. The ftpaccess configuration file should be similar to:

NOTE: class all real *

compress yes all tar yes all

log commands real log transfers anonymous,real inbound,outbound

upload /home/user1 /home/user1/sub yes user1 users 0666 dirs


The second column for the upload line must match the user's home directory according to the /etc/passwd file.

# grep user1 /etc/passwd
user1:a5xEYGzeQ:123:20::/home/user1:/sbin/sh

2. Add -a option to the ftp entry in the /etc/inetd.conf configuration file.

#grep ^ftp /etc/inetd.conf
ftp          stream tcp6 nowait root /usr/lbin/ftpd     ftpd -l -a

3. Restart inetd daemon.

# inetd -c

Reference

Authors

This page was last modified on 3 August 2010, at 03:11. This page has been accessed 3,932 times.