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.

SSH and "root"

Discussion in 'General Discussion' started by Xiode, Dec 21, 2006.

  1. Xiode

    Xiode Well-Known Member

    Joined:
    Oct 14, 2005
    Messages:
    73
    Likes Received:
    0
    Trophy Points:
    6
    a while back just after we got the server I tried setting up a user to login to shell with. Then I could just su to root. like your suppose to well I was unable to get su to work. so I abandoned it until a later date.. I could login no problem. I had so many pressing things to setup and do.. Well recently I was reading a tutorial on a program setup and noticed that it recommended to su to root... Well I got back to playing with it and the problem persists... Tell me if I am doing this wrong... I logged in to root the normal way with "root" "pass".... then "adduser **** " then "passwrd **** " and logged out of SSH using root.. and logged in with ****. Now when I su I get this.

    ****@satellite1 [~]# su
    -bash: /bin/su: Permission denied

    Is there another way in WHM that I accomplish this.. or am I just being stupid and doing it the wrong way...
     
  2. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    WHW > Security > Manage Wheel Group Users

    add the user to the group....
     
  3. Xiode

    Xiode Well-Known Member

    Joined:
    Oct 14, 2005
    Messages:
    73
    Likes Received:
    0
    Trophy Points:
    6
    knew I had to be doing something wrong... Now can't I take root off that list and use then new name... that wouldn't let anyone be able to login with root and you could still login with **** and then su to root?
     
  4. mctDarren

    mctDarren Well-Known Member

    Joined:
    Jan 6, 2004
    Messages:
    664
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    New Jersey
    cPanel Access Level:
    Root Administrator
    Not sure if removing root from wheel will cause permission problems when you su into it from your login user account... ? Never actually thought about that one before. :)

    However you can stop ssh from allowing root to login by editing the sshd conf file. Usually /etc/sshd/sshd_config - find the line "PermitRootLogin" and change the value after it to "no". Restart and it will no longer accept root login.

    Be sure to test logging in through your other account and switching into root - using "su -", not just "su". Once you know it works you can disable root login as described above. I also recommend using only Protocol 2, and changing the default port to avoid those annoying dictionary attacks.
     
  5. Xiode

    Xiode Well-Known Member

    Joined:
    Oct 14, 2005
    Messages:
    73
    Likes Received:
    0
    Trophy Points:
    6
    Works perfectly :)
     
Loading...

Share This Page