rss
twitter
    Find out what I'm doing on Twitter

Howto Add a User to Sudoers List On Ubuntu

Believe me or not i am replying this, howto add a user to sudoers list on Ubuntu, question every day so after sending my last reply to this question here is the blog post to stop getting this question as an e-mail :) Like my all blog posts this is also verified me on Ubuntu Karmic, PClinuxOS 2009.2.

Open a terminal (alt+f2 gnome-terminal , use a dropdown terminal, whatever you want.) and give this command as ROOT :

$su -
Enter your root password (or your username's password on some distros)
#visudo

Now use your Up/Down arrows (you may prefer PgUp and PgDn keys) and navigate to this line :

root ALL=(ALL) ALL

Under that line add this line (DO NOT FORGET TO CHANGE "user" part with your username!) :

user ALL=(ALL) ALL

You can use Shift + Insert to paste.
To save, write :w (hit enter of course) to save.To exit, write :quit and hit enter.I am poor at vi/vim or whatever you call that :)
You can find the sample screenshot of sudoers file (the part we have edited) at the beginning of my blog post.

3 comments:

Anonymous said...

Why wouldn't you just add the user to the admin group?

sudo adduser some_user admin

Anonymous said...

hi im on ubuntu, and I lost (my only) account sudo thing,, and still don't know how to get it back :(

Anonymous said...

What if there is no admin group...
useradd user admin
group admin doesnt exist.

Post a Comment