Page 1 of 1

How can I automatically set folder permissions to 755 and file permissions to 644?

Posted: Thu Apr 29, 2021 7:54 pm
by RideTheWave
When I'm uploading the thousands of the Open Cart files to a server, I want folders to have the default permission of 755 and files to have the default permission of 644. It used to do this automatically with FileZilla. However, after moving to a different server all the folders are being given a permission of 775 and files a permission of 664. It's very painstaking and time consuming to manually change the permission of every folder and file. Is there a way to have folders automatically set to 755 and files to 644? If so, is this done through FileZilla or is it done through CPanel?

One thing to note is that with the new server I only seem to be able to connect via SFTP (not regular FTP). With the old server I was able to connect with regular FTP so I'm not sure if FTP vs SFTP has anything to do with it.

Re: How can I automatically set folder permissions to 755 and file permissions to 644?

Posted: Thu Apr 29, 2021 8:18 pm
by thekrotek
Use SSH

Re: How can I automatically set folder permissions to 755 and file permissions to 644?

Posted: Thu Apr 29, 2021 9:03 pm
by RideTheWave
Can you please be more specific? Are you talking about using a program like Putty or Extra Putty? Can't this be done through the FTP program FileZilla or even through the server's settings in WHM or CPanel?

Re: How can I automatically set folder permissions to 755 and file permissions to 644?

Posted: Thu Apr 29, 2021 9:28 pm
by rjcalifornia
RideTheWave wrote:
Thu Apr 29, 2021 7:54 pm
When I'm uploading the thousands of the Open Cart files to a server, I want folders to have the default permission of 755 and files to have the default permission of 644. It used to do this automatically with FileZilla. However, after moving to a different server all the folders are being given a permission of 775 and files a permission of 664. It's very painstaking and time consuming to manually change the permission of every folder and file. Is there a way to have folders automatically set to 755 and files to 644? If so, is this done through FileZilla or is it done through CPanel?

One thing to note is that with the new server I only seem to be able to connect via SFTP (not regular FTP). With the old server I was able to connect with regular FTP so I'm not sure if FTP vs SFTP has anything to do with it.
Ok, it really depends of the hosting provider. Sometimes, file permissions are correctly applied when you do it throught the cPanel's File Manager. If you are having difficulties changing file permissions, I strongly suggest you to get in touch with your hosting tech support, and tell them to change the file permissions for you.

Re: How can I automatically set folder permissions to 755 and file permissions to 644?

Posted: Thu Apr 29, 2021 9:38 pm
by thekrotek
RideTheWave wrote:
Thu Apr 29, 2021 9:03 pm
Can you please be more specific? Are you talking about using a program like Putty or Extra Putty? Can't this be done through the FTP program FileZilla or even through the server's settings in WHM or CPanel?
Any SSH client will do the job, even Terminal in cPanel. This is the fastest way.

Re: How can I automatically set folder permissions to 755 and file permissions to 644?

Posted: Fri Apr 30, 2021 4:46 am
by RideTheWave
rjcalifornia wrote:
Thu Apr 29, 2021 9:28 pm
RideTheWave wrote:
Thu Apr 29, 2021 7:54 pm
When I'm uploading the thousands of the Open Cart files to a server, I want folders to have the default permission of 755 and files to have the default permission of 644. It used to do this automatically with FileZilla. However, after moving to a different server all the folders are being given a permission of 775 and files a permission of 664. It's very painstaking and time consuming to manually change the permission of every folder and file. Is there a way to have folders automatically set to 755 and files to 644? If so, is this done through FileZilla or is it done through CPanel?

One thing to note is that with the new server I only seem to be able to connect via SFTP (not regular FTP). With the old server I was able to connect with regular FTP so I'm not sure if FTP vs SFTP has anything to do with it.
Ok, it really depends of the hosting provider. Sometimes, file permissions are correctly applied when you do it throught the cPanel's File Manager. If you are having difficulties changing file permissions, I strongly suggest you to get in touch with your hosting tech support, and tell them to change the file permissions for you.
I'm not familiar with using SSH. I tried using cPanel's File Manager. The permissions do seem to be correct when uploading from cPanel's File Manager but it seems that you can only upload files though, not folders or subfolders. You first have to create a folder or subfolder, then upload files into it. There are hundreds or thousands of folders and subfolders in Open Cart. Is there a way to just drag an entire folder in which automatically brings with it all of its subfolders and files? Changing the permissions manually on every single folder and file is the most time consuming aspect of migrating an Open Cart site. There's got to be a way.

Re: How can I automatically set folder permissions to 755 and file permissions to 644?

Posted: Fri Apr 30, 2021 4:54 am
by straightlight
RideTheWave wrote:
Fri Apr 30, 2021 4:46 am
rjcalifornia wrote:
Thu Apr 29, 2021 9:28 pm
RideTheWave wrote:
Thu Apr 29, 2021 7:54 pm
When I'm uploading the thousands of the Open Cart files to a server, I want folders to have the default permission of 755 and files to have the default permission of 644. It used to do this automatically with FileZilla. However, after moving to a different server all the folders are being given a permission of 775 and files a permission of 664. It's very painstaking and time consuming to manually change the permission of every folder and file. Is there a way to have folders automatically set to 755 and files to 644? If so, is this done through FileZilla or is it done through CPanel?

One thing to note is that with the new server I only seem to be able to connect via SFTP (not regular FTP). With the old server I was able to connect with regular FTP so I'm not sure if FTP vs SFTP has anything to do with it.
Ok, it really depends of the hosting provider. Sometimes, file permissions are correctly applied when you do it throught the cPanel's File Manager. If you are having difficulties changing file permissions, I strongly suggest you to get in touch with your hosting tech support, and tell them to change the file permissions for you.
I'm not familiar with using SSH. I tried using cPanel's File Manager. The permissions do seem to be correct when uploading from cPanel's File Manager but it seems that you can only upload files though, not folders or subfolders. You first have to create a folder or subfolder, then upload files into it. There are hundreds or thousands of folders and subfolders in Open Cart. Is there a way to just drag an entire folder in which automatically brings with it all of its subfolders and files? Changing the permissions manually on every single folder and file is the most time consuming aspect of migrating an Open Cart site. There's got to be a way.
At this point, better to follow the last step from this post: viewtopic.php?f=202&t=223604#p820142 .

Re: How can I automatically set folder permissions to 755 and file permissions to 644?

Posted: Fri Apr 30, 2021 6:40 pm
by paulfeakins
If your host shows the "Terminal" icon in cPanel you can do it from there with these 2 commands that must be run once you've cd'd to public_html:

Change all folders to 755

Code: Select all

find . -type d -print0 | xargs -0 chmod 0755
Change all files to 644

Code: Select all

find . -type f -print0 | xargs -0 chmod 0644