My server uses CENTOS 6. (I am upgrading to 7 this next weekend)
When I use Filezilla (SFTP) to upload php scripts the permission is set to 664 and the script cannot be used until I change the permission to 644. I do not think that Filezilla is the problem.
Using SSH I confirmed that umask = 022, which is correct.
Since that umask setting should result in the desired file permission of 644 there must be a setting somewhere that is overriding the system umask setting.
I downloaded /etc/profile and saw these lines:
if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then
umask 002
else
umask 022
fi
I changed unmask 002 to 022, uploaded the profile and restarted my server.
That had no effect. PHP files that I upload still get a permission of 664 which is wrong.
Where else should I look to find whatever is overriding the system umask?
I am still a bit of a novice admin so please do not be too cryptic with any advice.
When I use Filezilla (SFTP) to upload php scripts the permission is set to 664 and the script cannot be used until I change the permission to 644. I do not think that Filezilla is the problem.
Using SSH I confirmed that umask = 022, which is correct.
Since that umask setting should result in the desired file permission of 644 there must be a setting somewhere that is overriding the system umask setting.
I downloaded /etc/profile and saw these lines:
if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then
umask 002
else
umask 022
fi
I changed unmask 002 to 022, uploaded the profile and restarted my server.
That had no effect. PHP files that I upload still get a permission of 664 which is wrong.
Where else should I look to find whatever is overriding the system umask?
I am still a bit of a novice admin so please do not be too cryptic with any advice.