LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Broke root account ... (https://www.linuxquestions.org/questions/linux-newbie-8/broke-root-account-836647/)

adloaiz 10-06-2010 07:22 PM

Broke root account ...
 
I deleted the root line in passwd and shadow and then tried to copy the backup and was able to put it all back to normal from rescue mode. However when i get to my login screen i can not login as root anymore or even after logged in as another user i can not su - or su root, it tells me that root user does not exist...... I am at a loss.... thanks

mf93 10-06-2010 08:55 PM

best bet would be to backup your files and customized settings and do a fresh reinstall

jdkaye 10-06-2010 10:14 PM

Your thread title, "Need super duper help", is not very informative and will cut down the number of answers you receive. I suggest you read the sticky and the beginning of this forum and this article.
jdk

repo 10-07-2010 03:03 AM

Welcome to LQ

Take a look at
http://www.cyberciti.biz/tips/recove...word-file.html

Kind regards

adloaiz 10-08-2010 07:47 PM

Ok is there a way to boot from a rescue disk and mount the drive and force a new root? I edited the passwd and shadow file and I am still receiving root user does not exist. I can recover all other accounts no problem I really need root.

animeman 10-08-2010 07:49 PM

of course its possible what os is it ubuntu because all you ahve to do is mount your drives and i would think copy it over but course that in theory i have never tryed it

adloaiz 10-08-2010 07:55 PM

redhat rel4

animeman 10-08-2010 08:01 PM

well then you probability could still boot into a live cd of it and copy the root over though if i'm not mistaken redhat costs money and they have a support team that should be able to help ya =]

adloaiz 10-08-2010 08:02 PM

thanks I will try it out

raviteja_s 10-09-2010 12:36 PM

go rescue mode

TB0ne 10-09-2010 03:47 PM

Quote:

Originally Posted by raviteja_s (Post 4122271)
INSTALL THIS PACKAGE !

setup-2.5.58-7.el5

Bad advice. First, the OP said it was RHEL4, not RHEL5. Second, how exactly do you expect to be able to install a package, when the OP said they couldn't log in as root???.

Please read the whole question and details, and post advice that can be helpful. This would only cause the OP to have MORE problems, even if it did work to start with.

mf93 10-09-2010 10:25 PM

if you find the install disk you used to install onto that computer, there should be an option such as 'start a rescue shell' which boots into sh with automatic root priveleges, at which point you can say passwd which will change the root password or edit the passwd and shadow files as you please or perhaps use adduser. Whichever option you choose, you will have root priveleges.

adloaiz 10-14-2010 08:23 PM

ok fixed the root problem..... KIND OF.... I used a CD to get root to make changes to the /etc/passwd and /etc/shadow. I remove the CD and boot up normal and able to login as root and everything is fine but, if I restart the server again everything breaks again. So I made a fix that I don't want to keep in place. I fixed it by chmod 666 passwd and shadow and I can reboot all day long and everything works but for obvious reason I don't want the mod to stay 666 but I really don't know what is making the change?

mf93 10-14-2010 11:30 PM

try chmod 600 and chown it as root

fiku 10-15-2010 01:50 AM

paste in or just modify the permissions to satisfy these one:
You should have sth like:
Code:

-rw-r--r-- 1 root root 1179 2010-10-14 23:14 /etc/passwd
-rw-r----- 1 root shadow 1047 2010-10-14 23:14 /etc/shadow



All times are GMT -5. The time now is 08:29 AM.