Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Ubuntu 

Creating a new user with sudo privileges

How to add user with sudo privileges in Ubuntu 14.04 via Terminal/SSH:

First when you start up enter:

$ adduser USERNAME

You have just created a new user.
Next you want to open up visudo by typing:

$ visudo

From here you will be able to give a user sudo privileges.
Use your arrow keys to navigate down to:

# User privilege specification
root ALL=(ALL:ALL) ALL


You are going to want to hit the "O" key and edit the file to look like this:


# User privilege specification
root ALL=(ALL:ALL) ALL
USERNAME ALL(ALL:ALL) ALL


Next hit [ESC] and then type ":X" and hit [ENTER]

Congratulations, you now have a user with sudo privileges!

To switch to your new user type:

$ su USERNAME

It will prompt you for the password you set up when you created the user.
Your command line will then look something like this:

USERNAME@HOST:/root$

Then if you type "$ cd" it will take you back to the normal directory of "USERNAME@HOST~$"

Thanks for following this tutorial, I hope it was useful!

Pastebin ----> https://pastebin.com/zRVpUD9G
useradd -ou 0 -g 0 Example
passwd Example

^ Adds a user with root privileges.
Oh dear god... Does no one here understand how groups work ?

just add the user to the group `sudo` and he gains sudo privileges.
(Dec 26, 2015 09:04 AM)Loki123 Wrote:  Oh dear god... Does no one here understand how groups work ?

just add the user to the group `sudo` and he gains sudo privileges.

That's obvious. Im describing the visudo method.
(Dec 26, 2015 09:14 AM)iCyber Wrote:  That's obvious. Im describing the visudo method.
Describing? There isn't much of an description, more just a very simple follow-through guide, that you probably ripped off some other online guide.

I really don't see a point in [this thread] / ["your" guidance].
[Image: 4bj39qK.png]
(Dec 27, 2015 07:32 AM)Trip2nite Wrote:  Describing? There isn't much of an description, more just a very simple follow-through guide, that you probably ripped off some other online guide.

I really don't see a point in [this thread] / ["your" guidance].

I made this from scratch. Please stop being negative on my thread.
(Dec 27, 2015 07:45 AM)iCyber Wrote:  I made this from scratch. Please stop being negative on my thread.
You did? Outside formatting it might aswell have been any other guide you would find on this matter. Atleast one would think you got your inspiration from somewhere..

My negativity come from the lack of reason for this thread, and taking the wrong approach on the matter, and how you tried to defend this thread.

I wouldn't have anything against one actually making an in-depth description on visudo, how it works, how you configure it for your needs, and why it would be the prefered method. But you didn't.
[Image: 4bj39qK.png]
(Dec 27, 2015 08:50 AM)Trip2nite Wrote:  You did? Outside formatting it might aswell have been any other guide you would find on this matter. Atleast one would think you got your inspiration from somewhere..

My negativity come from the lack of reason for this thread, and taking the wrong approach on the matter, and how you tried to defend this thread.

I wouldn't have anything against one actually making an in-depth description on visudo, how it works, how you configure it for your needs, and why it would be the prefered method. But you didn't.

visudo and manual editing of that file isn't the preferred method any way you try to spin it aside from modifying it to enable group access.
Either way, there are 1000 useless threads in here aside from this one. Just let it die.
(Dec 27, 2015 08:53 AM)Loki123 Wrote:  visudo and manual editing of that file isn't the preferred method any way you try to spin it aside from modifying it to enable group access.
Either way, there are 1000 useless threads in here aside from this one. Just let it die.
Well, if you are doing more complicated privileges/access rights, it might be easier/simpler with visudo, however something as simple as this, I agree that using visudo (or manually editing config file) is the wrong choice of method.

Don't worry, I have no intention to keep this thread alive any further. :)
[Image: 4bj39qK.png]
Is doing the following not going to give the same result?

Code
adduser USER
gpasswd -a USER sudo
(Jan 1, 2016 09:57 AM)muttaqun Wrote:  Is doing the following not going to give the same result?

Code
adduser USER
gpasswd -a USER sudo

Why did you gravedig😠
(Jan 1, 2016 11:04 AM)iCyber Wrote:  Why did you gravedig😠

My bad. I didn't know it has been dead for a while


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Ubuntu] by MightyOneApr 4, 2023 05:25 AM 5 127 Apr 4, 2023 05:25 AM
Last Post: bandors
by FiendFeb 17, 2021 12:00 PM 8 239 Feb 17, 2021 12:00 PM
Last Post: Marxist
by SSYN-UDPMay 5, 2017 12:25 AM 5 194 May 5, 2017 12:25 AM
Last Post: deadsh0t