LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   I deleted my root user... (https://www.linuxquestions.org/questions/linux-newbie-8/i-deleted-my-root-user-429509/)

patdawg 03-28-2006 11:44 PM

I deleted my root user...
 
Please don't laugh. I just started using Linux two days ago, and now I feel like a total idiot. I was messing around with creating new users, but didn't save my changes. When I went back into the Users and Groups manager it gave me an error and didn't open up. So, I logged off the root account, and once it got back to the login screen root was gone. I still have two regular users, but I cant "su" to gain superuser priveledges because there is no root user. The Users and Groups manager doesn't work in either of these accounts either. Is there any way of getting root back without doing a reinstall?

masonm 03-28-2006 11:55 PM

Lmao...........

rkelsen 03-29-2006 12:19 AM

How TF does one accomplish this feat?

I'm guessing that your /etc/passwd file is damaged. Try copying the backup file ( /etc/passwd- ) back to /etc/passwd.

Failing that, re-install.

patdawg 03-29-2006 12:28 AM

Quote:

Originally Posted by rkelsen
How TF does one accomplish this feat?

I'm guessing that your /etc/passwd file is damaged. Try copying the backup file ( /etc/passwd- ) back to /etc/passwd.

Failing that, re-install.

I made a rescue CD that boots into a shell okay...so that I can edit my /etc/passwd file, but how do I mount, and navigate my hardrive from the CD's shell?

And dangit, there's no jot, or nedit on this rescue disk. How do I edit my passwd file without those?

ntubski 03-29-2006 01:11 AM

To mount the harddrive you'll need to know which partition Linux is installed on. The command will be something like
Code:

mount /dev/hdaN /mnt
where N is the partition number. Then you cd to /mnt to see your harddrive.


Nano is a simple editor that's pretty common, what CD do you have? If all else fails, it'll have vi :jawa:

muha 03-29-2006 03:56 AM

if you fail at vi, here's what i do: first copy the text from the file (or just select it with your mouse)
Then:
Code:

cat > file_you_want_it_in
now either type away or
paste your text by doing <Shift><Insert>  OR
<Ctrl><Shift><Insert>  to paste selected text.
<Ctrl>+d to stop cat-ting (it also saves the file).


ethics 03-29-2006 04:40 AM

I'm curious how this is done, surely you must be root in order to delete the account, what happens if logged in as root and you delete yourself? (nothing from your experience?) what happens to root owned files? are they then parentless and inaccessible?

What an odd thing to do :P

Also a note is that some users are created for services.applications like mysql (i think) etc.

So be careful what you delete.

asimba 03-29-2006 05:19 AM

which distro you are using - with red hat when you try rescue option it gives you '/mnt/sysimage'

do chroot to /mnt/sysimage thereafter you can change /etc/password - you may have do a few other things as well :)

In given case probably you were using gui to create users/groups.(you said you didnt save changes :) )

patdawg 03-29-2006 09:46 AM

Thanks, my problem now is that the rescue disk I have must not have SATA drivers. That's what my system drive is, and I can't mount it when in the rescue disk's shell. Any idea where I can get a rescue disk with SATA drivers? I don't have my original Linux distros.

asimba 03-29-2006 10:05 AM

How did you install linux in the very first place - What distro you are running?

patdawg 03-29-2006 10:27 AM

Quote:

Originally Posted by asimba
How did you install linux in the very first place - What distro you are running?

Red Hat Enterprise Edition Update 2...it was preinstalled on our Intellistation A-Pro when it arrived. I'm downloading the distros now. Which disk should I use as my rescue CD?

ethics 03-29-2006 10:33 AM

Quote:

Originally Posted by patdawg
Red Hat Enterprise Edition Update 2...it was preinstalled on our Intellistation A-Pro when it arrived. I'm downloading the distros now. Which disk should I use as my rescue CD?

I dont understand this, what 'distros' are you downloading?? it's usually a good idea to use a rescue disk that is part of your distro, in this case RHEL. You can try Fedora (community based RH testbed, but very good) they have a rescue cd, i'm sure it has SATA drivers (it would be a bit silly if their distro was installable on SATA but the rescue cd couldnt rescue a system on it...)

http://fedora.redhat.com/Download/mirrors.html

Pick a mirror close to you, the ,iso you need is cunningly named rescuecd

patdawg 03-29-2006 10:39 AM

Quote:

Originally Posted by ethics
I dont understand this, what 'distros' are you downloading?? it's usually a good idea to use a rescue disk that is part of your distro, in this case RHEL. You can try Fedora (community based RH testbed, but very good) they have a rescue cd, i'm sure it has SATA drivers (it would be a bit silly if their distro was installable on SATA but the rescue cd couldnt rescue a system on it...)

http://fedora.redhat.com/Download/mirrors.html

Pick a mirror close to you, the ,iso you need is cunningly named rescuecd

I'm downloading the following from my manufacturer's FTP:

RHEL4-U2-x86_64-WS-disc1
RHEL4-U2-x86_64-WS-disc2
RHEL4-U2-x86_64-WS-disc3
RHEL4-U2-x86_64-WS-disc4
RHEL4-U2-x86_64-WS-disc5

demented_are_go 03-29-2006 01:30 PM

*blink* if you allowed yourself to mess around like that, still not sure just -how- someone manages to delete the root account on a box, then you can probably afford to just reinstall that box, which is likely to be faster and easier than trying to fix the problem.

patdawg 03-29-2006 01:37 PM

Quote:

Originally Posted by demented_are_go
*blink* if you allowed yourself to mess around like that, still not sure just -how- someone manages to delete the root account on a box, then you can probably afford to just reinstall that box, which is likely to be faster and easier than trying to fix the problem.

I may do that, but there is a lot of other stuff on here that I would have to reconfigure. The machine is a film editing/visual fx workstation, and all the software for those apps would take forever to reinstall/reconfigure.


All times are GMT -5. The time now is 07:03 AM.