LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-28-2006, 11:44 PM   #1
patdawg
LQ Newbie
 
Registered: Mar 2006
Distribution: Red Hat Enterprise Linux 4 Update 2
Posts: 14

Rep: Reputation: 0
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?
 
Old 03-28-2006, 11:55 PM   #2
masonm
Senior Member
 
Registered: Mar 2003
Location: Following the white rabbit
Distribution: Slackware64 14.2 Solus
Posts: 2,264

Rep: Reputation: 51
Lmao...........
 
Old 03-29-2006, 12:19 AM   #3
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 2,019

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
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.
 
Old 03-29-2006, 12:28 AM   #4
patdawg
LQ Newbie
 
Registered: Mar 2006
Distribution: Red Hat Enterprise Linux 4 Update 2
Posts: 14

Original Poster
Rep: Reputation: 0
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?

Last edited by patdawg; 03-29-2006 at 12:34 AM.
 
Old 03-29-2006, 01:11 AM   #5
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Arch
Posts: 3,136

Rep: Reputation: 1336Reputation: 1336Reputation: 1336Reputation: 1336Reputation: 1336Reputation: 1336Reputation: 1336Reputation: 1336Reputation: 1336Reputation: 1336
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
 
Old 03-29-2006, 03:56 AM   #6
muha
Member
 
Registered: Nov 2005
Distribution: xubuntu, grml
Posts: 451

Rep: Reputation: 37
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).
 
Old 03-29-2006, 04:40 AM   #7
ethics
Senior Member
 
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522

Rep: Reputation: 45
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.
 
Old 03-29-2006, 05:19 AM   #8
asimba
Member
 
Registered: Mar 2005
Location: 127.0.0.0
Distribution: Red Hat / Fedora
Posts: 355

Rep: Reputation: 42
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 )
 
Old 03-29-2006, 09:46 AM   #9
patdawg
LQ Newbie
 
Registered: Mar 2006
Distribution: Red Hat Enterprise Linux 4 Update 2
Posts: 14

Original Poster
Rep: Reputation: 0
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.
 
Old 03-29-2006, 10:05 AM   #10
asimba
Member
 
Registered: Mar 2005
Location: 127.0.0.0
Distribution: Red Hat / Fedora
Posts: 355

Rep: Reputation: 42
How did you install linux in the very first place - What distro you are running?
 
Old 03-29-2006, 10:27 AM   #11
patdawg
LQ Newbie
 
Registered: Mar 2006
Distribution: Red Hat Enterprise Linux 4 Update 2
Posts: 14

Original Poster
Rep: Reputation: 0
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?
 
Old 03-29-2006, 10:33 AM   #12
ethics
Senior Member
 
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522

Rep: Reputation: 45
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
 
Old 03-29-2006, 10:39 AM   #13
patdawg
LQ Newbie
 
Registered: Mar 2006
Distribution: Red Hat Enterprise Linux 4 Update 2
Posts: 14

Original Poster
Rep: Reputation: 0
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
 
Old 03-29-2006, 01:30 PM   #14
demented_are_go
Member
 
Registered: Mar 2006
Distribution: Fedora Solaris Slackware
Posts: 50

Rep: Reputation: 15
*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.
 
Old 03-29-2006, 01:37 PM   #15
patdawg
LQ Newbie
 
Registered: Mar 2006
Distribution: Red Hat Enterprise Linux 4 Update 2
Posts: 14

Original Poster
Rep: Reputation: 0
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent! Deleted Root! goosie Mandriva 12 06-30-2005 07:50 PM
Deleted user Root? legendaryfox Linux - Software 4 01-09-2005 01:12 PM
root account Deleted chandu Linux - Security 1 06-18-2004 12:47 PM
i deleted my user jonesnm Fedora 1 05-20-2004 10:20 AM
Deleted root user france Linux - Newbie 1 04-30-2004 06:57 AM


All times are GMT -5. The time now is 02:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration