First: all you need to do is add the following line to the sudoers file in /etc/sudoers
user_name ALL=(ALL) ALL
Replace user_name with your own user ID
however, you have to use the visudo command to edit the file while being root
so, here is what you need to do:
open a new terminal
switch to root, type "su" then enter the root password
type "visudo" and you will see the sudoers file opened for editting
go to the end of the file and type the line
user_name ALL=(ALL) ALL
Again, Make sure you replace user_name with your own user ID
then hold the CTRL key and press "o" to save the file and confirm by pressing enter
now hold CTRL key and press "x" to exit the program
type "exit" to exit root mood
then now type sudo gedit and enter your password
if everything went well, you should see the gedit program
you are done,
Enjoy,
Update: How to add a user to Sudoers account in Ubuntu?
I found out that if you create a new account using "adduser" you do not get the sudoers group by default
so,
- Open a terminal using another account such as root or main account
- type "sudo nano /etc/sudoers"
- Go to the end of the file and type the following
- user_name ALL=(ALL)ALL
- Replace user_name with your new user name
- Save the file and exit "Ctrl x" when asked type y and press Enter to confirm the file name
- now log out and login using that user_name and you should have the sudo command working
I tested this process on an embedded Debian system, works great.
No comments:
Post a Comment