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.

Change Owner / Modify Account in WHM With VPS

Discussion in 'General Discussion' started by johndoe, Oct 24, 2015.

  1. johndoe

    johndoe Active Member

    Joined:
    May 26, 2002
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    Hello Forum Members -

    Currently using a cPanel / WHM VPS setup. I created about 15 domains using WHM. Then I uploaded using SFTP all the files for all 15 domains.

    Afterward I found I could not modify any files by logging in via SFTP as the account username. So I went into WHM to discover that ALL the accounts had "root" as the owner.

    Still in WHM I went to "Change Account Owner" and was redirected to "Modify An Account". When I selected the account I wanted to modify, I was directed to the modification page. Under the drop down box for "Account Owner" the only option was "root".

    So I logged in via SSH and changed all the account ownerships from root to the username on the account:

    root@******** [~]# chmod -R +rx /home/username/
    root@******** [~]# chown -R username:username /home/username/

    Even after restarting apache the account usernames still appear as "root" in the WHM when listing accounts or trying to "Modify An Account".

    Although now I CAN modify account files via SFTP logging in as the user instead of "root", and I DO see the changes to the accounts when logging in via SSH, the WHM will simply not display the account usernames, nor will it allow changes from "root" to those usernames. WHM still shows all accounts as owned by "root".

    I guess it's not big deal if someone knows how to log in via SSH and change ownership / permissions, but for those relying on the GUI of WHM to help them accomplish those changes it can be frustrating.

    Is there a way I might not know about using WHM to change the account owner from "root" to the account username when on a WHM VPS?

    Best wishes,

    themuse
     
  2. flashweb

    flashweb Well-Known Member

    Joined:
    Mar 13, 2003
    Messages:
    243
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Ownership shown in WHM means which WHM user owns the account. In your case, you logged in as user root and created these accounts.

    If you created a reseller in WHM, any accounts (sites) created by this reseller will be shows as owned by that user.

    In cpanel, you should always use sites FTP/SFTP user name and password to upload files. Never use root.
     
  3. johndoe

    johndoe Active Member

    Joined:
    May 26, 2002
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    Thanks for the knowledge. The owners are in fact changed in each account, and I can now upload via SFTP using the username of each account. But even though the owners of the accounts are now the account username (as changed via SSH) I find it odd that WHM does not reflect the internal changes. Take care, and thanks again for the reply.
     
  4. 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 :)

    I believe you are confusing file ownership with account ownership. The ownership value you see in Web Host Manager is there to let you know if the account was created under "root" or by a reseller. This has no relation to the ownership of the files within the account.

    Thank you.
     
  5. johndoe

    johndoe Active Member

    Joined:
    May 26, 2002
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    Thank you cPanelMichael: No, I'm not confusing the two ownerships. But what you are telling me, apparently, is that there was NEVER a way to change ACCOUNT ownership in WHM. I'm using a VPS now. For years I owned my own cPanel Server and for some reason I seem to remember that changing OWNER was a simple matter of clicking on the "Change Ownership Of An Account" (which is under the "Resellers" section but NOW redirects one to the "Modify An Account" heading under the "Account Functions" feature. When one tries to change ownership of an account under the "Modify An Account" heading there is no owner choice other than "root" at that link.).

    So, apparently, what I remember as a section in WHM which actually allowed me to change OWNER of an account is just a figment of my poor memory and never existed. Of course, I don't believe that. I believe the function actually did exist at one time. Maybe it still does, but NOT when using a VPS.

    As I stated, I WAS able to change account ownership using SSH, and can now upload / download / edit files using SFTP. However, even though the ACCOUNT ownership WAS changed using SSH, ownership STILL shows as "root" in WHM.

    Again, thank you for the response.
     
  6. 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 :)

    Using the "chmod" and "chown" commands has never been a method to change the account owner. You can change the owner of the account while logged into WHM as "root" via:

    "WHM -- Account Functions -- Modify an Account"

    Thank you.
     
  7. johndoe

    johndoe Active Member

    Joined:
    May 26, 2002
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    Thank you for the response. It seems you may be not really reading my posts thoroughly enough.

    FIRST: From my very first post:

    "Still in WHM I went to "Change Account Owner" and was redirected to "Modify An Account". When I selected the account I wanted to modify, I was directed to the modification page. Under the drop down box for "Account Owner" the only option was "root"."

    SO the solution you offered to which I'm replying here does not work. There was and is no way to change owner using my WHM.

    SECOND:

    "So I logged in via SSH and changed all the account ownerships from root to the username on the account:

    root@******** [~]# chmod -R +rx /home/username/
    root@******** [~]# chown -R username:username /home/username/"

    You're telling me that "Using the "chmod" and "chown" commands has never been a method to change the account owner. " - yet those are the commands recommended by the tech support of the VPS hosting company (very reputable cPanel server host) as well as the commands I used when owning my own cPanel server at LiquidWeb from 2005-2010. In fact ALL of my cPanel account owners WERE changed using those commands. The change of ownership shows up when I login via SSH but NOT in WHM, which still shows every account owner is "root" (As I stated in previous posts).

    So I want to thank you for taking the time to answer my question while letting you know that your answer seems incorrect and incomplete.

    Best wishes,

    johndoe
     
  8. 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 :)

    There are two forms of ownership discussed here. First, is the ownership of the account itself. It's either owned by "root", or by a reseller account username. This is in no way related to the ownership of the files within the account's home directory. It's to determine which accounts belong to a reseller, and which accounts belong to root. What you are referring to in your posts is the ownership of the files/directories in the account's home directory. The ownership of the files/directories is completely unrelated to the option you are referring to. The only way to change ownership of these files/directories is through the use of the "chown" command.

    Thank you.
     
Loading...

Share This Page