FTP service Umask setting

xantra

Dabbler
Joined
Mar 30, 2017
Messages
15
Hi All,
I noticed that the TrueNAS gui to setup the FTP service was missing the "other" permission field for newly created files, meaning that the last character of Umask for files is always 6.
1625071134722.png

Code:
Umask 026 022


Is this a bug or is this intentional ?
I would like to change the 6 into a 2 in my case, but doing so manually in /usr/local/etc/proftpd.config get's overwritten when the service starts.
Any idea how I could make this change permanent considering that this option isn't available in the GUI ?

Thanks
 

bsalmon

Cadet
Joined
Jun 26, 2022
Messages
2
Hi All,
I noticed that the TrueNAS gui to setup the FTP service was missing the "other" permission field for newly created files, meaning that the last character of Umask for files is always 6.
View attachment 48070
Code:
Umask 026 022


Is this a bug or is this intentional ?
I would like to change the 6 into a 2 in my case, but doing so manually in /usr/local/etc/proftpd.config get's overwritten when the service starts.
Any idea how I could make this change permanent considering that this option isn't available in the GUI ?

Thanks
I went to log this as a bug but it appears someone logged it last month. It is logged as issue NAS-116328 on https://jira.ixsystems.com

I also (with the help of a friend) worked out a work-around that will persist a service restart.

## Add 'proftpd_config="/usr/local/etc/proftpd.conf.fixed"' to the bottom of your rc.conf file
sudo echo 'proftpd_config="/usr/local/etc/proftpd.conf.fixed"' >>/etc/rc.conf
## copy the proftpd.conf file, changing the UMask to meet your requirements
sudo sed 's/Umask 026/Umask 022/' </usr/local/etc/proftpd.conf >/usr/local/etc/proftpd.conf.fixed
 

bsalmon

Cadet
Joined
Jun 26, 2022
Messages
2
My config above is broken, it doesn't survive reboots (and sudo doesn't handle the append correctly). The below should work as intended.

## Elevate to root
sudo su -
## Add 'proftpd_config="/etc/proftpd.conf.fixed"' to the bottom of your master rc.conf file
echo 'proftpd_config="/etc/proftpd.conf.fixed"' >>/conf/base/etc/rc.conf
## copy the proftpd.conf file, changing the UMask to meet your requirements
sed 's/Umask 026/Umask 022/' </usr/local/etc/proftpd.conf >/conf/base/etc/proftpd.conf.fixed
## Exit root shell
exit

Restart ftpd or reboot.
 
Top