Skip to main content

Hardening my VPS, how can I qualify it's done correctly?

Comments

5 comments

  • quizknows
    Make sure you can 'su -' to root from the additional user. If you can, then you should be fine disabling direct root login in the ssh server configuration. Generally I don't use sudoers, I just add the additional user to the wheel group so that it can 'su -' to get root privileges in a way that requires a password. This way if the password for the additional user is compromised, they won't have root privileges without the root password as well.
    0
  • PhoenixUK
    Make sure you can 'su -' to root from the additional user. If you can, then you should be fine disabling direct root login in the ssh server configuration. Generally I don't use sudoers, I just add the additional user to the wheel group so that it can 'su -' to get root privileges in a way that requires a password. This way if the password for the additional user is compromised, they won't have root privileges without the root password as well.

    Hi There, Thanks for the prompt reply and I have to admit having heard what you've put above, I maybe better carrying it out the way you mention via wheel group. Would I still leave my new user with root privileges in the sudoers, or need to remove this now and do it the wheel group way instead? Hmmm if I enter; su - to root from the newuser, I get the following; -bash: /bin/su: Permission denied So it would seem something isn't 100%, gutted I thought I was going well grrrr. I will await your feedback on the above before I do anything else. Thank you.
    0
  • PhoenixUK
    My apologies, it does seem that I can but I got myself all confused. mynewuser@[~]# su - Password: entered root pass here root@vps [~]# Bingo.
    0
  • quizknows
    It seems you have it straightened out, but if you add a user to the wheel group it allows them to run the 'su -' command. You would not need to leave the user in sudoers, and it is more secure this way given the password auth to run commands as root. Cheers.
    0
  • cPanelMichael
    Hello :) To note, for other users that may see this thread, the SSH hardening guide that's referenced here is found at:
    0

Please sign in to leave a comment.