How To Create a Sudo User on Ubuntu

How To Create a Sudo User on Ubuntu

The sudo command provides a mechanism for granting administrator privileges, ordinarily only available to the root user, to normal users. This guide will show you the easiest way to create a new user with sudo access on Ubuntu, without having to modify your server’s sudoers file. If you want to configure sudo for an existing user, simply skip to step 3.

Steps to Create a New Sudo User

  1. Log in to your server as the root user.
    • ssh root@server_ip_address
  2. Use the adduser command to add a new user to your system.Be sure to replace username with the user that you want to create.
    • adduser username
    • Set and confirm the new user’s password at the prompt. A strong password is highly recommended!
      Set password prompts:
      Enter new UNIX password:
      Retype new UNIX password:
      passwd: password updated successfully
      
    • Follow the prompts to set the new user’s information. It is fine to accept the defaults to leave all of this information blank.
      User information prompts:
      Changing the user information for username
      Enter the new value, or press ENTER for the default
          Full Name []:
          Room Number []:
          Work Phone []:
          Home Phone []:
          Other []:
      Is the information correct? [Y/n]
      
  3. Use the usermod command to add the user to the sudo group.
    • usermod -aG sudo username

    By default, on Ubuntu, members of the sudo group have sudo privileges.

  4. Test sudo access on new user account
    • Use the su command to switch to the new user account.
      • su – username
    • As the new user, verify that you can use sudo by prepending “sudo” to the command that you want to run with superuser privileges.
      • sudo command_to_run
    • For example, you can list the contents of the /root directory, which is normally only accessible to the root user.
      • sudo ls -la /root
    • The first time you use sudo in a session, you will be prompted for the password of the user account. Enter the password to proceed.
      Output:
      [sudo] password for username:
      

      If your user is in the proper group and you entered the password correctly, the command that you issued with sudo should run with root privileges.


Comments (27)

  • minecraft

    you are truly a excellent webmaster. The website loading
    velocity is amazing. It sort of feels that you’re doing any distinctive trick.
    Moreover, The contents are masterpiece. you’ve done a wonderful task
    in this matter!

  • minecraft

    Hey! Do you know if they make any plugins to assist with SEO?
    I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good gains.
    If you know of any please share. Thank you!

  • minecraft

    Wow! In the end I got a webpage from where I be capable of really obtain helpful facts regarding my study
    and knowledge.

  • minecraft

    Very good article! We are linking to this great
    post on our site. Keep up the good writing.

  • minecraft

    This info is worth everyone’s attention. When can I find out more?

  • minecraft

    Admiring the hard work you put into your blog and
    in depth information you offer. It’s awesome to come across
    a blog every once in a while that isn’t the
    same out of date rehashed information. Fantastic read!
    I’ve bookmarked your site and I’m including your RSS feeds
    to my Google account.

  • minecraft

    Thanks for sharing your thoughts on how to create a sudo user on ubuntu.

    Regards

  • minecraft

    Hi, I log on to your blogs like every week. Your writing style is witty,
    keep it up!

  • minecraft

    Asking questions are in fact good thing if you are not understanding something totally, but this piece
    of writing offers fastidious understanding even.

  • minecraft free download 2018

    I am in fact delighted to glance at this weblog posts which contains lots of valuable data, thanks for
    providing these kinds of information.

  • minecraft free download 2018

    Attractive section of content. I just stumbled upon your web site and in accession capital to assert that
    I get actually enjoyed account your blog posts. Anyway I’ll be subscribing to your feeds and even I achievement you access
    consistently quickly.

  • minecraft free download 2018

    Fine way of explaining, and pleasant post to get information regarding my presentation focus,
    which i am going to present in school.

  • minecraft free download 2018

    Just want to say your article is as surprising. The clarity in your post is just cool and i could assume you’re an expert on this subject.
    Fine with your permission let me to grab your feed to keep updated with forthcoming
    post. Thanks a million and please continue the rewarding work.

  • minecraft free download 2018

    You need to take part in a contest for one of the highest quality
    blogs on the web. I will recommend this site!

  • minecraft free download 2018

    It’s a shame you don’t have a donate button! I’d certainly donate
    to this fantastic blog! I suppose for now i’ll settle for bookmarking and adding your RSS feed to my Google account.
    I look forward to brand new updates and will share this website with my Facebook group.
    Talk soon!

  • minecraft free download 2018

    These are in fact enormous ideas in about blogging. You have touched some pleasant
    points here. Any way keep up wrinting.

  • tinder dating site

    Hello to all, as I am truly keen of reading this web site’s post
    to be updated daily. It carries pleasant data.

  • tinder dating site

    I’m impressed, I must say. Seldom do I come across a blog that’s both educative and amusing,
    and without a doubt, you have hit the nail on the head.

    The problem is an issue that not enough folks are speaking intelligently about.
    I am very happy I found this during my hunt for something regarding this.

  • tinder dating site

    Hi colleagues, how is the whole thing, and
    what you would like to say concerning this post, in my view its really remarkable designed
    for me.

  • minecraft secret free download

    Hey there! Do you use Twitter? I’d like to follow you
    if that would be ok. I’m definitely enjoying your blog
    and look forward to new updates.

  • minecraft secret free download

    Wonderful goods from you, man. I’ve be mindful your stuff previous to and you’re simply too magnificent.

    I really like what you have got right here, really like what you are saying and the
    way in which wherein you assert it. You’re making it entertaining and you continue to
    take care of to keep it sensible. I can not wait to learn much more from
    you. That is really a tremendous web site.

  • Coconut Oil Benefits

    If you would like to get a great deal from this article then you have to
    apply these methods to your won web site.

  • Coconut Oil Benefits

    Ahaa, its good dialogue on the topic of this paragraph here at this weblog, I have
    read all that, so at this time me also commenting here.

  • Coconut Oil Benefits

    I’m not sure exactly why but this weblog is loading very slow
    for me. Is anyone else having this problem or is it a issue on my end?
    I’ll check back later and see if the problem still exists.

  • What Equipment is Needed for Sling TV

    I’m gone to say to my little brother, that he should also visit this weblog on regular basis to take updated from hottest reports.

  • What Equipment is Needed for Sling TV

    It’s remarkable to go to see this web page and reading the
    views of all mates concerning this piece of writing, while I am also keen of getting experience.

  • Google

    Google

    Please take a look at the websites we comply with, such as this one particular, because it represents our picks in the web.

Leave a Reply

Your email address will not be published. Required fields are marked *