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.

PermitRootLogin "without-password"

Discussion in 'Security' started by ronaldst, Mar 5, 2017.

Tags:
  1. ronaldst

    ronaldst Active Member

    Joined:
    Feb 22, 2016
    Messages:
    28
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Norway
    cPanel Access Level:
    Root Administrator
    I'm running CPanel on a VPS with CentOS 7. I want to secure the SSH and have limited logins to use a certificate/sshkey. I've made a new user, 'myuser' and added him to the group 'wheel'.

    ssh_config
    Code:
    # Allowed Users
    AllowUsers root myuser
    
    # Enable/Disable tunneled clear text passwords
    PasswordAuthentication no
    visudo
    Code:
    ## Allows people in group wheel to run all commands
    %wheel  ALL=(ALL)       ALL
    I am now only able to login using my sshkey. Any attempt to login with a password is rejected. Great!

    Now.. When I run 'My Security Advisor' in CPanel it tells me me to change PermitRootLogin to "without-password" or "no".

    (CSF does not give any complaint's regarding this matter.)

    I am a little inexperienced and do not want this server to go tits up. I do not need to login as root directly, but I do need to be able to 'su' and 'sudo'.

    Am I safe to change PermitRootLogin to "no" and still be able to 'su -' from 'myuser'?
     
  2. SysSachin

    SysSachin Well-Known Member

    Joined:
    Aug 23, 2015
    Messages:
    542
    Likes Received:
    39
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Yes, you will be able to login using 'su -' from 'myuser' even if you have set PermitRootLogin to "no"
     
    cPanelMichael and ronaldst like this.
  3. ronaldst

    ronaldst Active Member

    Joined:
    Feb 22, 2016
    Messages:
    28
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Norway
    cPanel Access Level:
    Root Administrator
    Thank you!
     
    cPanelMichael likes this.
  4. SysSachin

    SysSachin Well-Known Member

    Joined:
    Aug 23, 2015
    Messages:
    542
    Likes Received:
    39
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hi,

    You are welcome

    If you are facing any issue then please update the post. I will check and assist you.
     
    ronaldst likes this.
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,029
    Likes Received:
    1,277
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    SysSachin likes this.
Loading...

Share This Page