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?
|
Lmao...........
|
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. |
Quote:
And dangit, there's no jot, or nedit on this rescue disk. How do I edit my passwd file without those? |
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 Nano is a simple editor that's pretty common, what CD do you have? If all else fails, it'll have vi :jawa: |
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 |
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. |
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 :) ) |
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.
|
How did you install linux in the very first place - What distro you are running?
|
Quote:
|
Quote:
http://fedora.redhat.com/Download/mirrors.html Pick a mirror close to you, the ,iso you need is cunningly named rescuecd |
Quote:
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 |
*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.
|
Quote:
|
All times are GMT -5. The time now is 07:03 AM. |