Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Mar 2010
    Posts
    5

    Default WHM and disabled ssh root access

    Hi,

    Working on setting a new VPS running WHM/cPanel.

    Currently ssh access is enabled for root, which is great for the initial setup.

    We'd like now to create a different ssh login account and disable the root account.

    I'm not entirely sure how admin actions work in WHM, does it need ssh root access to work or is it independent?

    Thanks
    Ben

  2. #2
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Default

    1. Use the "useradd <login>" to create a new user in SSH

    2. Change the user's password "passwd <login>"

    3. Use 'chsh' or check /etc/passwd to make sure you got "/bin/bash" as the shell which it should be but you'll kick yourself later if it isn't.

    4. Assign the user to "wheel" group. If you don't know how to do this
    manually, there is a menu option in WHM to do precisely this.

    5. Edit /etc/ssh/sshd_config
    Code:
    Find this line:
    
    #PermitRootLogin yes
    
    Uncomment if necessary and change to this:
    
    PermitRootLogin no
    (While you are in there changing ports and protocols is good too)

    Save and restart your SSH server ("service sshd restart")

    Now before you exit your current SSH session, open up a new SSH window and login with the new login name and then use "su -" to escalate yourself to root entering root password when asked.

    If you can't login --- you didn't do something right

    If you are able to login with the new user and upgrade yourself to root
    then you did everything correctly and it's safe to log out of your
    original ssh session at that point.

Similar Threads & Tags
Similar threads

  1. SSH access not working for root
    By connop in forum New User Questions
    Replies: 5
    Last Post: 01-30-2007, 03:10 PM
  2. SSH Password disabled only for root account?
    By tomfra in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 01-21-2007, 03:12 AM
  3. SSH access becomes disabled
    By hal in forum cPanel and WHM Discussions
    Replies: 17
    Last Post: 10-16-2006, 05:28 AM
  4. how to enable root ssh access
    By simonlee in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 07-03-2003, 12:57 AM
  5. How do i regain root access now cp4 disabled su
    By obantec in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 04-17-2002, 08:05 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube