Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Dec 2010
    Posts
    4

    Default Is it possible to change root access to another user?

    I am looking to change root access so that another user has full access rights and then disable root access as my server is being probed and attacked by hackers. Is it possible to transfer root ownership to another user on the server?

  2. #2
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    7,894
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Is it possible to change root access to another user?

    You can't disable root user. You can create another user, for example a reseller account and give that user limited or full access via Reseller Center in WHM. That won't stop the problems you're hoping it will though.

    ...my server is being probed and attacked by hackers.
    Can you be more specific? For example if you're seeing in your logs IP addresses attempting to login via SSH on port 22, we change the port SSH uses, make sure it works, and then disable port 22. No one else knows your new SSH port number and those entries stop appearing in your logs.

  3. #3
    Registered User
    Join Date
    Dec 2010
    Posts
    4

    Default Re: Is it possible to change root access to another user?

    Hi there,

    Yes i can be more specific I have Brute Force enabled and someone from Japan tried logging in as root last night (Day time thier time) as this was emailed to me when this activity happened by the Brute Force protection. This was definately via root via my IP address and using :2086 so disabling port 22 wont make any difference.

  4. #4
    Registered User
    Join Date
    Dec 2010
    Posts
    4

    Default Re: Is it possible to change root access to another user?

    Hi there, This person has additionally tried logging in today and here is the log:
    Apr 14 09:29:54 tiger sshd[9695]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=118.159.231.205 user=rootApr 14 09:29:56 tiger sshd[9695]: Failed password for root from 118.159.231.205 port 54377 ssh2Apr 14 09:29:58 tiger sshd[9764]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=118.159.231.205 user=rootApr 14 09:30:00 tiger sshd[9764]: Failed password for root from 118.159.231.205 port 54556 ssh2Apr 14 09:30:00 tiger sshd[9799]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=118.159.231.205 user=root
    Good old Brute Force has put a permenant block on his IP address.
    Is there anything else I can do to secure my server up?

  5. #5
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    7,894
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Is it possible to change root access to another user?

    That snip of your log shows that the user was trying to login via SSH, not WHM. This is also, quite common.
    Do you have CSF installed as well? ConfigServer Security & Firewall If not you should look into it, IMHO.

    Strong, very hard to guess passwords that you change on a regular basis can also be very helpful.

  6. #6
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Is it possible to change root access to another user?

    You could use Host Access Control in WHM to limit sshd and whostmgrd logins to your IP address(es) and then deny all other IP addresses. If you do that, then you won't have to worry about them even trying to brute your machine because all IPs that aren't allowed will be blocked from connecting.

    To allow your IP(s) and then deny all others for sshd and whostmgrd, you'd put this into WHM > Host Access Control area:

    Code:
    Daemon 	   Access List  Action  Comment
    sshd 	   1.2.3.4 	allow 	My home IP for SSH
    sshd 	   1.2.3.5  	allow 	My office IP for SSH
    sshd 	   ALL 	        deny 	Deny access from all other IPs for SSH
    whostmgrd  1.2.3.4      allow   My home IP for WHM
    whostmgrd  1.2.3.5  	allow  	My office IP for WHM
    whostmgrd  ALL 	  	deny 	Deny access from all other IPs for WHM
    In the above example, 1.2.3.4 and 1.2.3.5 are your IPs to allow for SSH and WHM access. Please note that the order does matter. The deny lines must be below the allow lines. If you deny before you allow, you'll block all IPs on the machine. As such, please ensure that you put your allow lines on top of (above) the deny ones.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  7. #7
    Registered User
    Join Date
    Aug 2006
    Posts
    1

    Default Re: Is it possible to change root access to another user?

    So is whostmgrd adding these entries via IPtables or is there another file these entries are being placed?

    My question is, what happens if my IP were to change and cannot access WHM? My only access then would be via console and would need to know how and where to update the IP to a new one to regain access to WHM.

    Thank you
    Chris

  8. #8
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Is it possible to change root access to another user?

    Hello Chris,

    The Host Access Control entries are placed into /etc/hosts.allow file for both the allow and deny rules for whostmgrd.

    Thanks!
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

Similar Threads & Tags
Similar threads

  1. Access user account from root WHM?
    By radeonpower in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 06-01-2011, 07:04 AM
  2. Change the user name root
    By 0101 in forum Feature Requests for cPanel/WHM
    Replies: 1
    Last Post: 12-28-2010, 04:19 PM
  3. API access with user credentials rather than root/reseller
    By rajuru in forum cPanel Developers
    Replies: 4
    Last Post: 11-17-2010, 06:53 AM
  4. cpanel error after change user root
    By aldesha989 in forum cPanel and WHM Discussions
    Replies: 13
    Last Post: 06-05-2009, 04:16 PM
  5. ERROR 1045: Access denied for user: 'root@localhost'
    By Jontxu40 in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 08-17-2003, 04:25 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube