Author Topic: SSH Folder & File Permissions issue  (Read 1737 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
SSH Folder & File Permissions issue
« on: September 12, 2022, 10:25:59 PM »
I hope I am not being daft but I'm having an issue with file and folder permissions on CWP.   

When I create a folder as a user in the CWP File Manager, it sets permissions to 755 and files 644.   This all works fine and serves the file correctly in the browser.  However, if I SSH into the server as a user and create a folder/file, it sets the folder permissions to be 775 and files 664 which causes a 500 error and logs:

SoftException in Application.cpp:249: File "/home/onapp/test/public/index.php" is writeable by group

I can of course use chmod to change the permissions manually afterwards which works fine BUT the issue comes when I use laravel and npm as it always writes the permissions incorrectly (775 and 664).

I have tried adding the user to the nobody group but that breaks it alltogether with a security exception in the log.

Can someone provide any pointers as to what I am doing wrong and how I can fix this issue? 

Offline
*
Re: SSH Folder & File Permissions issue
« Reply #1 on: October 17, 2022, 12:15:37 AM »
public_html should be owner:nobody 755
everything inside should be owner:owner-group
folders 755
files 644 (unless it is an executable)

/home/onapp/test/public/index.php check this path unless you made a custom entry the path should look like this:
/home/onapp/publid_html/test/public/index.php (this is default path) 8)
Owner
440Music Entertainment Co
OnLine Broadcasting since March 6, 1999
www.440music.com