SUMMURY: File permissions and FTP

From: Jim Brown (jbrown22@erols.com)
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

        #!/bin/sh
        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
problematic
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
/bin/sh
and reboot:

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

Note: the trailing ".sh" of the scriptname is important, if you don't
specify
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