Top VPS Hosting Provider

Welcome to the myhosting.com Forums.
+ Reply to Thread
Results 1 to 7 of 7

Thread: Super-user

  1. #1
    juc1 is offline Silver Member
    Join Date
    Dec 2010
    Posts
    45

    Default Super-user

    Hi all,

    With my linux VPS I log in to SSH using root and $HOME is /root. Is it ok for me to log in as the super-user / admin like this or should I create a separate user accounts to work with, even though the only user is myself?

    Thanks

  2. #2
    suwunk is offline Super Moderator
    Join Date
    Aug 2010
    Posts
    1,081

    Default

    One of the biggest security holes you could open on your server is to allow directly logging in as root through ssh, because any cracker can attempt to brute force your root password and potentially get access to your system if they can figure out your password.

    It’s much better to have a separate account that you regularly use and simply sudo to root when necessary. Before we begin, you should make sure that you have a regular user account and that you can su or sudo to root from it.
    details:
    Security Tip: Disable Root SSH Login on Linux - How-To Geek
    Disable ssh root direct login

    Hope this helps!

  3. #3
    juc1 is offline Silver Member
    Join Date
    Dec 2010
    Posts
    45

    Default

    OK thank you. I have created a new user so how do I give the SUDO permission to this user?

    thanks

  4. #4
    jeremya is offline Administrator
    Join Date
    Jun 2008
    Posts
    270

    Default

    just enter "sudo" before any command you run if the command requires administrative (root) access. So using apt-get to install the php package for example you would enter: "sudo apt-get install php" . You'll be prompted for the user password, after which it will process the command.
    -Jeremya

  5. #5
    juc1 is offline Silver Member
    Join Date
    Dec 2010
    Posts
    45

    Default

    Quote Originally Posted by jeremya View Post
    just enter "sudo" before any command you run if the command requires administrative (root) access. So using apt-get to install the php package for example you would enter: "sudo apt-get install php" . You'll be prompted for the user password, after which it will process the command.
    Ok thanks so does that mean that any new account can automatically use 'sudo' - ie doesn't first require permission to use sudo? Is there some harmless command I can use to test that sudo works ok for my new user?

    Thanks

  6. #6
    suwunk is offline Super Moderator
    Join Date
    Aug 2010
    Posts
    1,081

    Default

    Here are some good tutorials about sudo with some usage example on it
    sudo - Linux Command - Unix Command
    Understanding and using sudo in Unix or Linux (with examples)

  7. #7
    juc1 is offline Silver Member
    Join Date
    Dec 2010
    Posts
    45

    Default

    Quote Originally Posted by suwunk View Post
    Here are some good tutorials about sudo with some usage example on it
    sudo - Linux Command - Unix Command
    Understanding and using sudo in Unix or Linux (with examples)
    OK thank you.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts