The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

VPS/WHM/cPanel permissions problem

Discussion in 'General Discussion' started by ridike, Dec 10, 2013.

  1. ridike

    ridike Registered

    Joined:
    Dec 10, 2013
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    Hi,

    Can anybody help me with a permissions problem on a VPS? Whenever I create a cPanel account and log in to FTP/SFTP to the new account, I don't have permissions to edit the files or to do different things with them. I have to login with the root user or to give 777 to the whole folder of the cPanel's account in order to be able to edit the files with the cPanel account.
    For example I upload a CMS package, unzip and install it but I can't because I don't have permissions to the folders/files, I have to log in with root to give the correct permissions. The same is when I install something with Softaculous, I can't edit the files afterwards, only with root user.

    Somebody told be something about the usergroups are not correctly set up. I couldn't find a solution on google, hopefully I can find here.

    Thank you very much!
     
  2. chrisbuk

    chrisbuk Well-Known Member
    PartnerNOC

    Joined:
    Dec 7, 2003
    Messages:
    393
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Liverpool, United Kingdom
    cPanel Access Level:
    DataCenter Provider
    Hi

    SSH to your server to / directory

    type: nano fixperms.sh

    paste:
    then control+X to close, and Y to save.

    then whenever you have permissions problems just ssh to server and type:

    sh fixperms.sh USERNAME (replace USERNAME with the username of the Cpanel user with the issue)

    this will fix the permissions of the users account.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Please keep in mind that it's not always a good idea to change ownership of all your home directory files to the account username. Some files may have ownership set to another value on purpose. Instead, access your server via SSH as root, and check the ownership values on the following directories and files within them:

    /home/$username

    Are any of these files owned by "root"?

    Thank you.
     
  4. pagchen

    pagchen Member

    Joined:
    Aug 19, 2007
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    BEWARE!
    This script will change the file permissions of files like .htpasswds in /home/username/ to less secure 0655.
    I think it would be better if the last "find" commands run only in $HOMEDIR/public_html folder.
    Even then as stated by CpanelMichael, it can put files that needs more secure permissions to less secure permissions inside the public_html folder.
     
Loading...

Share This Page