Lost Administrator Priviligies

Asked by Spirit

I have lost my admin priviligies today, when I created a new user, I needed that user only for 15 minutes so after that I have delete it, but the user is steal there as well as admin user which doesn t have admin priviligies anymore, I wanted to create a backup of my documents but I can t even burn a CD, it says ... Error while burning ... I hope you could help me to gain my admin permisions back because I can t afford to lose my data.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Florian Hackenberger
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Maurizio Moriconi (bugman) said :
#1

Hi!
Try to enter in recovery-mode from grub.
From this mode you have admin privilegies and then you can

- create a new user with admin priv.

- add admin priv. to an existing user (add the user to admin groups)

Bye

Revision history for this message
williamts99 (williamts99) said :
#2

https://wiki.ubuntu.com/LivecdRecovery

Best Regards,

Williamts99

Revision history for this message
Spirit (mojster-team) said :
#3

None of the above work, I tried to solve the problem by burning files on the USB or on the card but it didn t work.

Revision history for this message
williamts99 (williamts99) said :
#4

If you followed the above wiki page that I had pasted, what part did not work for you?

Revision history for this message
Spirit (mojster-team) said :
#5

I have get to number two, number three didn t work so I couldnt continue, I have just found out that I don t have permissions to write on CDs, Diskets, USB or any other think I wanted to reinstal Ubuntu but I can t because I don t have permisions to backup my data. Does anyone now how I can get my data from the compluter to CD or USB would work too. Please Please Please ... backing up its my first priority at this moment I can reinstall ubuntu but now withouth backups.

Revision history for this message
Florian Hackenberger (f-hackenberger) said :
#6

It is completely unnecessary to reinstall Ubuntu just because your standard user is not a member of the admin group. Here is a rough outline of what you should try:

1. Reboot your computer.
2. Right after the bios loading finished there should either be a list of boot entries to select (something like "Ubuntu, kernel 2.6.17-10-generic" and "Ubuntu, kernel 2.6.17-10-generic (recovery mode)") or a message along the lines of : "Press ESC to view the boot menu" (in this case press ESC). Please select the entry with "recovery mode" at the end.
3. After pressing enter to boot the entry and waiting some time you should be at the console prompt (press Ctrl-Alt-F1 if the Ubuntu logo does not go away after a while).
4. You are root now (you have administration privileges)
5. Enter "groups YOURUSERNAMEHERE" and check if admin is listed (I suspect it is not)
6a. Enter the following (on one line and press enter):
usermod -G `groups YOURUSERNAME | sed 's/.*: //' | sed 's/ /,/g'`,admin YOURUSERNAME
6b. If that fails or you do not want to type all that, just type "vi /etc/group" and search for a line which looks like "admin:x:111:YOUROTHERUSERNAME". On this line append ",YOURUSERNAME", so that it reads: "admin:x:111:YOUROTHERUSERNAME,YOURUSERNAME". DO NOT CHANGE ANYTHING ELSE, just append ",YOURUSERNAME".
7. Reboot
8. You should be able to login and use sudo
9. Using the GNOME user manager make sure your user is a member of at least the following groups: "YOURUSERNAME adm dialout cdrom floppy audio dip video plugdev lpadmin scanner admin"

If you fail at step 6, try the following instead of step 6 (you can to that additionally to step 6. just to be sure):
useradd -m -G admin tempuser
passwd tempuser
Enter a new password and login as that user after rebooting. Now you can use the GNOME user editor to add your old user to the admin group (and the others listed above). After logging in as you regular user and checking that sudo works, just delete tempuser.

Hope this helps. If you are stuck, just email me at <email address hidden> and I will post here ASAP.

Regards, Flo

Revision history for this message
Spirit (mojster-team) said :
#7

Didn t work I have get to number 6, but then it didn t want to save the file is it possible you would do that remotely?

Revision history for this message
Florian Hackenberger (f-hackenberger) said :
#8

Well, what exactly weren't you able to do?

> is it possible you would do that remotely?
Hmm that would be possible, but is probably a bit hard to set up (depending on how you connect your Linux computer to the internet). If the computer is on a LAN behind a router you control it would be quite easy. But have you got another computer you can use to talk to me on VoIP, chat, irc? If you haven't you could just call me on the phone (if calling to Austria if not too expensive for you).

Revision history for this message
Florian Hackenberger (f-hackenberger) said :
#9

Ahm...Why didn't you just do:
useradd -m -G admin tempuser
passwd tempuser
? There is nothing that can go wrong with this. After rebooting you should login as tempuser and use the GNOME user manager to fix your regular user.

Revision history for this message
Spirit (mojster-team) said :
#10

It is a bit expensive and my mum would kill me for the bil, anyway it would be great if you could help me set up the CD or DVD writer so I could burn my data on, that would help a lot!

Revision history for this message
Spirit (mojster-team) said :
#11

I tried that, didn t work

Revision history for this message
Florian Hackenberger (f-hackenberger) said :
#12

What didn't work. Did one of the two commands fail? If it did what was the error message? If the commands succeeded, where you able to login as tempuser? If you were able to login what did you try next?

To be able to record a cd you have to be member of the group cdrom

But please try to answer my questions as detailed as you can. I'm sure we can fix your system quite easily. There is no need to reinstall. Forget about the windows principle 'reinstalling solved my problem'. There are VERY few reasons for reinstalling a Linux system. I installed mine 4 years ago and it is still running fine after three Ubuntu upgrades.

Revision history for this message
Spirit (mojster-team) said :
#13

Ok, here we go:

1. Reboot your computer. - (SUCEED)

2. Right after the bios loading finished there should either be a list of boot entries to select (something like "Ubuntu, kernel 2.6.17-10-generic" and "Ubuntu, kernel 2.6.17-10-generic (recovery mode)") or a message along the lines of : "Press ESC to view the boot menu" (in this case press ESC). Please select the entry with "recovery mode" at the end. - (SUCEED)

3. After pressing enter to boot the entry and waiting some time you should be at the console prompt (press Ctrl-Alt-F1 if the Ubuntu logo does not go away after a while). - (SUCEED)

4. You are root now (you have administration privileges) - (SUCEED)

5. Enter "groups YOURUSERNAMEHERE" and check if admin is listed (I suspect it is not) - (SUCEED admin was listed at least I think)

6a. Enter the following (on one line and press enter):
usermod -G `groups YOURUSERNAME | sed 's/.*: //' | sed 's/ /,/g'`,admin YOURUSERNAME (I DID 6B)

6b. If that fails or you do not want to type all that, just type "vi /etc/group" and search for a line which looks like "admin:x:111:YOUROTHERUSERNAME". On this line append ",YOURUSERNAME", so that it reads: "admin:x:111:YOUROTHERUSERNAME,YOURUSERNAME". DO NOT CHANGE ANYTHING ELSE, just append ",YOURUSERNAME". - (SUCCED BUT DIDN T NOW HOW TO SAVE)

7. Reboot - (SUCEED)

8. You should be able to login and use sudo - (UNABLE)

9. Using the GNOME user manager make sure your user is a member of at least the following groups: "YOURUSERNAME adm dialout cdrom floppy audio dip video plugdev lpadmin scanner admin" (UNABLE)

If you fail at step 6, try the following instead of step 6 (you can to that additionally to step 6. just to be sure):
useradd -m -G admin tempuser - (useradd: unable to lock password file)

Revision history for this message
Spirit (mojster-team) said :
#14

Everything would be good if the damm menu wouldn t dissepiear, I have only a few think in system administration : Firestarter, printer and some more like I m a standart user, the biggest think I hate is that sound doesn t work, I can print so thats great, it doesn t detect USB and I can t burn a CD or DVD so bassicaly like I m a user with minimum rights.

Revision history for this message
Best Florian Hackenberger (f-hackenberger) said :
#15

Ok, I see! You can save the file in vi as follows:
:wq
The colon lets you enter a command. w is short for 'write' and 'q' is short for 'quit'. You could as well type:
:w
then stare at your monitor for a while ;-)
:q
That would save the file and then quit afterwards instead of quitting immediately.

But if admin is listed when typing 'groups YOURUSERNAME' you have a different problem. Now please do the following:
Follow step 1, 2, 3, 4 and 5 and check if admin is listed. If it is not do step 6b, but now save the file as shown above. If admin is listed, do:
useradd -m -G admin tempuser
passwd tempuser
while still being in RECOVERY mode. This will fail if you booted in regular mode, since you haven't got admin privileges.

Revision history for this message
Spirit (mojster-team) said :
#16

Problem solved ... thank you ... very much I apreciate your help I hope I will be able to help you one day as well. Thanks again

Revision history for this message
Spirit (mojster-team) said :
#17

t

Revision history for this message
Spirit (mojster-team) said :
#18

User confirmed that the request is solved.

Revision history for this message
Florian Hackenberger (f-hackenberger) said :
#19

So the:
useradd -m -G admin tempuser
passwd tempuser
saved the day? Were you able to fix the group memberships of your regular user? You have to make sure you are a member of the groups 'adm dialout cdrom floppy audio dip video plugdev lpadmin scanner admin' otherwise you will not be able to use certain parts of your system. E.g. plugdev let's you access USB sticks, lpadmin let's you add printers to your system...

Glad I could help.

Revision history for this message
Spirit (mojster-team) said :
#20

Yes, I have set everything up.

Revision history for this message
Florian Hackenberger (f-hackenberger) said :
#21

Great, I hope you have a lot of fun with your Ubuntu Linux!