5

I recently got a new user account for Ubuntu 12.04 on Linux after becoming unable to log in to one of my earlier accounts. I can log in to this account easily enough, but when I try to use the password to install software through the Ubuntu Software Center, it reads:

Your authentication attempt was unsuccessful. Please try again.

I tried installing the software through the terminal with this:

sudo apt-get install

But when I entered my password, I got this message:

[username] is not in the sudoers file. This incident will be reported.

I searched here for a solution, and I found the answer here, which told me to open a root terminal. I don't know how to do this, but I found out I could get a root terminal by entering this in a normal terminal:

sudo -i

Upon doing this, I was asked to enter my sudo password, and I got the same message as before. What am I missing or doing wrong?

Zanna
  • 69,223
  • 56
  • 216
  • 327
user252617
  • 331
  • 1
  • 2
  • 4
  • http://askubuntu.com/questions/410244/a-command-to-list-all-users-in-ubuntu – sohel4r Apr 28 '14 at 18:42
  • @user252617 [You Should Read This](http://www.psychocats.net/ubuntu/fixsudo) – Sagar Panchal Apr 28 '14 at 19:05
  • possible duplicate of [How do I reset a lost administrative password?](http://askubuntu.com/questions/24006/how-do-i-reset-a-lost-administrative-password) – guntbert Apr 30 '14 at 19:35
  • @guntbert Not a duplicate. The password is fine (he can login) but he isn't in the sudoers file. Different problem. – Seth May 01 '14 at 02:00
  • @Seth, no - he hast lost access to the administrative account - the account he has access to isn't one. – guntbert May 01 '14 at 07:15
  • @guntbert Upon rereading it, he is indeed using two accounts. Now the dilemma do we answer the question he asked or the question that lead him here.. – Seth May 01 '14 at 14:50

3 Answers3

4

You can boot into recovery mode, start a root shell from there and add your user account to the sudo group with adduser USERNAME sudo.

Another solution is, once you are in the root shell, to edit the sudoers file as the thread you linked suggests.

See Broke my sudoers password, how do I reset it without using sudo? for details.

Zanna
  • 69,223
  • 56
  • 216
  • 327
2

It looks like you are not allowed to execute commands as root user. Be sure your user account is in the group sudo (type id or grep $USER /etc/group to find out).

If it is not, you have to get it in there. Try to launch your system in recovery mode, you should be able to access a single user root shell from there. Then you can type adduser your_username sudo. This should fix the problem.

Zanna
  • 69,223
  • 56
  • 216
  • 327
ju.kreber
  • 21
  • 4
2

Log in as either root or a user that does have sudo access, then type: visudo and add the user you're having trouble with to the sudoers file.

Zanna
  • 69,223
  • 56
  • 216
  • 327
xBytez
  • 21
  • 1