Skip to main content

Script to fix users home permissions?

Comments

9 comments

  • RicardoFC
    Hi, You can use this commands: cd /home/cpaneluser ls -all | grep public_html chown -R cpaneluser.cpaneluser public_html
    0
  • cPAusaf
    Hello, The main issue is knowing which PHP handler is being used and adjusting the permissions and ownership accordingly. cPanel does not provide any scripts that automatically fixes this unfortunately. There are a few places online which have permission/ownership scripts that usually work good when using the suPHP handler. If using DSO or CGI, that is where issues may occur if using one of the scripts incorrectly.
    0
  • akust0m
    Hi, You can use this commands: cd /home/cpaneluser ls -all | grep public_html chown -R cpaneluser.cpaneluser public_html

    Unfortunately this wouldn't work for all situations I'm afraid, especially if you are using lsapi with Litespeed as public_html and addon document roots need to have 'nobody' as the group. I was more looking at an script to fix everything within a users home directory, not just public_html.
    Hello, The main issue is knowing which PHP handler is being used and adjusting the permissions and ownership accordingly. cPanel does not provide any scripts that automatically fixes this unfortunately. There are a few places online which have permission/ownership scripts that usually work good when using the suPHP handler. If using DSO or CGI, that is where issues may occur if using one of the scripts incorrectly.

    No worries at all. It would be amazing if cPanel developed a script that would fix permissions with auto handler recognition :) I'll look around, but I might end up trying to write my own bash script :)
    0
  • Muhammed Fasal
    This is a simple bash script I wrote to fix the permissions and ownership of files within a cpanel account. To use, simply copy the script into your server, chmod 755, and pass the usernames as arguments: ./fixperms user1 user2
    You can see the script here, let me know if it helps.
    0
  • NabiKAZ
    0
  • NabiKAZ
    I found this script: Simple Bash Script to Fix Account Permissions - The cPanel Admin Is this script acceptable?
    0
  • cPRex Jurassic Moderator
    The cPanel Admin is a great resource, but since that script is ten years old, it might be a good idea to test this on a test machine before trying it on a production server.
    0
  • Futureen
    I found this script: Simple Bash Script to Fix Account Permissions - The cPanel Admin Is this script acceptable?

    Thanks, worked for me : )
    0
  • cPRex Jurassic Moderator
    I'm glad to hear that worked well!
    0

Please sign in to leave a comment.