Sunday 9 March 2014

Add user to sudoers file

This concerns Linux users. Well, you guys installed this savvy flavor, you opened up the terminal to update so you typed the usual sudo command. But, got something on the lines
User is not in the sudoers file.  This incident will be reported
Let's face it, most of the system functions can be accessed with sudo. So, you need to add the user to this monstrosity. Now, you just need to:
  • Change to root (Don't ask me how! This how-to covers something else)
  • Type vim /etc/sudoers and press Enter. Here instead of vim you could use anything you want like gedit, nano, and the rest.
  • Under User Privilege Specification section add the line
Yourusername ALL = (ALL) ALL
  • Press Esc (Escape key)
  • Type :wq and press Enter. (Well basically, this is saving the file, so if you have used anything other than vim, you know which steps to follow to save the file.)
  • Restart the system
And that's that. After this try sudo again and I am pretty sure, this time around you not get that nagging message.

This is one of the methods to add your username. If your preferred method is not here, then please comment.

As Always thanks for reading and please comment.

No comments:

Post a Comment

Stuff that most try to do