Author Topic: Pure-FTP Umask Not Working  (Read 7895 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Pure-FTP Umask Not Working
« on: June 05, 2016, 09:32:40 PM »
When I upload a new file to a test website I get the 500 error when attempting to view the page.  It is because the file permissions (664) are wrong by default.  I know you can edit the Pure FTP server config file to change the Umask so by default files have a permission of 644.  For some reason on CWP this doesn't seem to work.  Despite having the proper mask the files still end up with a permission of 664.  I am running CWP on CentOS 6.8.  This should work and it is driving me nuts.  I've exhausted every other resource trying to find a solution to this problem.  What is the solution to this?

Offline
*
Re: Pure-FTP Umask Not Working
« Reply #1 on: June 05, 2016, 10:00:33 PM »
Of course now that I've posted this discussion I figure out the problem.  Hours wasted.  The solution as simple and I hope this post stays in the forum to server as a little help to other frustrated techies.

When you can't get Umask to work properly with FTP it never hurts to make sure you are connecting with FTP and NOT sFTP.  I discovered this by accident when I connected to the server using FTP on another test VPS and discovered the perms were showing differently in the client.  One was showing rwx and the other numbers like 0644.  It was then that I figured all was not well in Kansas.  That is when I realized I was an idiot and was working with the wrong protocol. I still needed to fix the Umask issue but that was fixed in sshd_config and not /etc/pure-ftpd/pure-ftpd.conf

I just edited /etc/ssh/sshd_conf and changed...

Subsystem       sftp    /usr/libexec/openssh/sftp-server

... to ...

Subsystem       sftp    /usr/libexec/openssh/sftp-server -u 022

Problem solved.  At least I have a few hours left in my Sunday.

Offline
*
Re: Pure-FTP Umask Not Working
« Reply #2 on: July 14, 2024, 01:18:42 AM »
I got this issue too, the umask is 133:022, and the new uploaded files are always 640 not 644
I tried your solution and not working, I really don't know what to do more

Offline
*****
Re: Pure-FTP Umask Not Working
« Reply #3 on: July 14, 2024, 04:10:23 AM »