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)
#visudoNow use your Up/Down arrows (you may prefer PgUp and PgDn keys) and navigate to this line :
root ALL=(ALL) ALLUnder that line add this line (DO NOT FORGET TO CHANGE "user" part with your username!) :
user ALL=(ALL) ALLYou 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:
Why wouldn't you just add the user to the admin group?
sudo adduser some_user admin
hi im on ubuntu, and I lost (my only) account sudo thing,, and still don't know how to get it back :(
What if there is no admin group...
useradd user admin
group admin doesnt exist.
Post a Comment