Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lost user ID and password to root, how to recover 3

Status
Not open for further replies.

Sina

Technical User
Jan 2, 2001
309
CA
Hi all,

The admin has left and removed "deleted the root id"
How can I recover it?

I do have access to the server.

Thanks for your help.
 
boot your computer and at the LILO prompt, type:

init=/bin/bash

when thrown into the shell, run the passwd command and change your password...

good luck
 
Hi,



Reboot to a lilo 'boot:' prompt (first exit any graphical lilo screen to get the text prompt as above). Then type 'linux 1' so it looks like :



boot: linux 1



press enter and the system will stop at runlevel 1. You will have a root prompt (you are root without logging in). Change the root password with 'passwd' and then do 'sync' a few types and 'init 6' to shutdown .. & reboot.



The only problem might be if the admin was crafty enought to set a password within lilo in which case you could have a few problems. If so try to find a boot floppy that may not have lilo password protected.



Regards
 
Thank you all for responding.
However since the admin has deleted the root id also, Can I just also simply create the id too?

After creating the ID how can I make sure that the ID I have created called "root" has really all the admin rights?

Thanks to all of you.

Sina
 
Hi, Sina!

The admin deleted the root account??
I didn't know that could be done.
I had admin privileges once on a Linux box, and I used to access it as 'root2', another super user account created for me.

I've read the posts answering to you in this trhead and I can't see if the root account can be deleted.
Anyway, there's a group called root, any user within that group has superuser privileges.

Am I right?

Good Luck! Arlequín
arlequin@montevideo.com.uy
 
See my FAQ in this forum under the "Security" heading. d3funct
zimmer.jon@cfwy.com
The software required `Windows 95 or better', so I installed Linux.

 
at boot do
Linux single
when you're at the prompt just do "passwd"
fill in twice your new pasword and reboot.
Your password is now set.

Greetz
JAVEWOLF
 
Hi,



Just for clarification 'linux single' at the boot prompt is functionally identical to 'linux 1' in my prior post...



Anyway, it's not too clear exactly what you mean when you say that 'root' was deleted. root is an inbuilt account (id 0 group 0) and cannot be deleted as such. However, I suppose it would be possible to delete the root user from /etc/passwd, /etc/shadow et al. Even so, you can still recover the situation in single-user maintenance mode as previously described (subject to lilo having a password set in which case you need a 'clean' boot disk).



If it still doesn't work let us have more detail as to what errors you get...



Regards
 
Hello,
The Root user uid is established by the Linux Kernel and cannot be deleted. The active account associated with uid 0 (root) can be removed but can be added just as easily.
1) Boot linux to single user mode as previously described (boot: linux 1)
2) useradd -u 0 -g 0 root
3) passwd root

This should re-establish the root account with the proper UID and GID.
If that doesn't work, you can try adding the correct information into /etc/passwd
root:x:0:0:root:/root:/bin/bash
Don't forget to run passwd to assigna password in /etc/shadow.

I hope this information was helpful.

-Out0fOrder
 
Thanks you all so very very much.
That great.
It worked perfect.

 
When I go to lilo prompt: I type linux single then I got the prompt the message is "old-password", so I forgot the password, so how can I type the old password when the purpose is to reset it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top