SUMMURY: File permissions and FTP

From: Jim Brown (
Date: Tue Apr 15 1997 - 21:22:07 CDT

Original Question:

>Hello everyone,
> I have a small BIG problem. I need to know how to control the file modes
>for FTP. I run Solaris 2.5.x and it seems that when a file is put by FTP
>its comes up with world rw. thats not what I want. Is there a way to set
>the umask for FTP? It does not follow the system profile.
> I will summarize the answers thanks.

Answers are only for using Sun FTPD:

These are the two most common. Thanks for all the responces. And sorry if
this had just been asked recently. I don't always have the time to read
this list. though I try. If only there could be more hours in a day!

Use a wrapper on /usr/etc/in.ftpd,

Wrapper: /usr/etc/in.ftpd.umask

        umask 022
        exec /usr/etc/in.ftpd $*

Remember to chmod +x on the wrapper.

Change ftp entry in /etc/inetd.conf

ftp stream tcp nowait root /usr/etc/in.ftpd.umask in.ftpd


>From the solaris 2.x FAQ

3.48) How can I prevent daemons from creating mode 666 files?

By default, all daemons inherit the umask 0 from init. This is most
for a service like ftp, which in
a standard configuration leaves all uploaded files with mode 666.

To get daemons to use another umask execute the following commands in
and reboot:

umask 022 # make sure gets created with the proper mode
echo "umask 022" > /etc/init.d/
for d in /etc/rc?.d
        ln /etc/init.d/ $d/

Note: the trailing ".sh" of the scriptname is important, if you don't
it, the script will will be executed in
a sub-shell, not in the main shell that executes all other scripts.


This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:11:50 CDT