I have tried both the steps provided in this forum.
But still the files permission is not changing while uploding.
But still the files permission is not changing while uploding.
Last edited by a moderator:
Could you let us know the specific steps you are taking when reproducing the issue? Also, please post the output from the following command:I have tried both the steps provided in this forum.
But still the files permission is not changing while uploding.
rpm -qa|grep suphp
There's an open case with CageFS that's discussed on the following post:On 2 different servers both running CentOS 7.3 with CloudLinux.
if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then
umask 002
else
umask 022
fi
if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then
umask 022
else
umask 022
fi
Could you confirm how the files are uploaded?uploaded files are given 0664 in stead of 0644
This is exactly what i did, but also in etc/bashc. It then worked fine. I was even having the problem without an ftp. For instance if i used the command wp core download. all files would be 664. After changing 002 to 022 in both these files, i was able to upload through ftp and through wp cli correctly.Hi
Coming back to this thread as I've just installed a new server and this issue has come back again. CENTOS 7.3 x86_64 using EA4 and suphp.
I have checked etc/profile and the umask settings in there are incorrect
I have updated them to;Code:if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then umask 002 else umask 022 fi
and restarted ssh but the same issue occurs - uploaded files are given 0664 in stead of 0644Code:if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then umask 022 else umask 022 fi
rudtekThis is exactly what i did, but also in etc/bashc. It then worked fine. I was even having the problem without an ftp. For instance if i used the command wp core download. all files would be 664. After changing 002 to 022 in both these files, i was able to upload through ftp and through wp cli correctly.
Reporting back. In my case things went a little bit differently but it worked out in the end (though I was almost ready to give in and submit a ticket). After I have modified /etc/profile and /etc/bashrc (as many advises say) nothing happened on the spot. But the next day, it was working correctly. So I took it to the next server (we have migrated all our servers to freshly installed cPanel due to the CentOS6 EoL issue) and again, it hasn't worked. This made me think that maybe the nightly upcp made a difference so I ran upcp and after that it worked.@AndyB78 - there's a few different workarounds posted in this thread:
![]()
Files and Folders Uploaded By sFTP Have Incorrect Permissions
There is a previous thread regarding a similar issue that is marked "solved," but I'm having problems with this after the supposed update fixed it, so I'm starting my own thread. The issue is that when I upload folders and files via sFTP the folders are set with the permissions 775 instead of...forums.cpanel.net
Can you try those and see if that gets things working? If not, it might be best to open a ticket with our team as it seems you've done a few things already to test this without getting positive results.
# It's NOT a good idea to change this file unless you know what you
# are doing. It's much better to create a custom.sh shell script in
# /etc/profile.d/ to make custom changes to your environment, as this
# will prevent the need for merging in future updates.
Thanks for the reply. So is editing etc/profile not needed then? Just /etc/bashrc?We don't edit that file automatically - that caution is just in there because doing the wrong thing can hurt the user's environment. Editing /etc/bashrc is still a valid workaround at this time.