Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

During OS installation, I created only one account. Let's call it howdy. I thought it would have sudo privileges but I was wrong.

I scoured the internet and this forum to find out how to add howdy to the sudoers' list. I was under the impression that usermod -a -G sudo username would work. I opened a root terminal and issued the command. I closed it.

Next I opened a normal terminal and issued the following command: sudo gedit /etc/openvpn/update-resolv-conf

The following are the error messages:

howdy@wendy:~$ sudo gedit /etc/openvpn/update-resolv-conf
sudo: unable to resolve host wendy
[sudo] password for howdy: 
howdy is not in the sudoers file.  This incident will be reported.
[sudo] password for howdy: 

Furthermore I discovered that my root password has changed to the password for howdy. This is odd.

So when I opened a root terminal I now had to enter the password for howdy (the original root password did not work) and issued the command visudo and scrolled down to the phrase # Allow members of group sudo to execute any command My account called howdy is not on it.

I need help with the following:

(1) Undo the changes brought about by usermod -a -G sudo username, especially to revert the root password to the original password I entered during OS installation. I don't know what the parameters -a and -G do.

(2) Show me how to add my account called howdy to the sudoers' list.

Thanks in advance.

share|improve this question
2  
Are you sure that you have installed Ubuntu and not another OS? In Ubuntu I'm sure that by default root account is disabled, but I see that you can use it. And in Ubuntu the account created during installation process has administrative privileges and is already a member of sudo group. So, again, what OS did you installed? –  Radu Rădeanu Mar 26 at 12:54
    
@Radu Rădeanu: I didn't actually install the OS myself. My classmate did it for me. You wrote that the account created during installation has admin rights and is already a member of sudo group. I did a search on this forum and the results turned up a few which requested help in adding accounts to the sudoers' list. –  n00b Mar 26 at 13:08
1  
...accounts but not the account from the installation time. So, again, what is your OS? Are you sure that is Ubuntu? –  Radu Rădeanu Mar 26 at 13:12
1  
It sounds like you are running debian, not Ubuntu. What does lsb_release -a say? –  psusi Mar 26 at 15:32

2 Answers 2

This should help you. -a appends to the group and should only be used with -G, which is the groups to append the user. To answer your question fully, to add someone to the sudoers group and to reset the root password:

su
passwd root
Enter new Unix password:
Confirm new Unix password:

Then:

usermod -a -G sudo howdy

Once this is done, you will need to restart in order for the new changes (adding howdy to the sudo group) to take effect.

share|improve this answer
    
Thanks for your help :) –  n00b Apr 2 at 14:40

You probably changed the wrong password without realizing it. This may be of use: Ubuntu User management. The article was written for Ubuntu Server 10.04 but should still be relevant.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.