14 replies
I ran across this solution:
You should be able to reboot into single user mode and fix your password file. You'll probably have to do a reset or cycle power unless you are using a machine that has a way to soft boot from
the keyboard. You'll want to run sync a few times before hitting the power button of course.
Found at the following thread:
http://www.sudo.ws/pipermail/sudo-workers/2000-March/thread.html#106
Another source:
"Restore root/usr file system"
http://axp603.gsi.de:8080/www/eng/vms/qaa/dux_rrest.htmlx
REMOVE SPACES from the pasted URLs
Another thread:
"Unix root user password problem"
http://www.computing.net/unix/wwwboard/forum/3004.html
REMOVE SPACES from the pasted URL
by gregberry
by alveden
Wish you would specify which flavour of unix you are using. Variations in booting procedures and password files.
Anyway in generic terms.
1. Use an boot up floppy/cdrom to boot into single user mode.
2. Mount the partition of the HD installation containing the /etc directory.
3. Insert/Modify entry of the password and the shadow password file.
4. Reboot using the HD installation
5. Login as root then change the root password.
Below are some steps for solaris and RedHat. However if you are no runing either, comment on your OS version and I give you the steps.
Step for a recovery on solaris OS
1. Insert the solaris installation disc 1 into cdrom drive.
2.a. If machine is still running and stop A is not diable, hit stop A to get to the "ok" prompt. Jump to 3
2.b If machine is not running, powercycle the machine and hit stop A to get the "ok" prompt.
3. Boot to single user mode from cd by entering this command - boot -s cdrom
4. do a "mount $PATHTOYOURDEV /a"
5. vi the /a/etc/passwd, check for the root entry .. either add/modify the line .. which should look something like this.
root:x:0:1:Super-User:/:/bin/sh
6. vi the /a/etc/shadow, insert/modify to this entry
root::::::::
*note the number of colonis essential, in both entry.
7. "cd /" then "umount /a"
8. Do a "boot -s" and that will take you back to the hard drive installation.
9. Change the password.
by alveden
Step for a recovery on RedHat linux OS
1. Insert the linux installation disc 1 into cdrom drive.
2. Powercycle the machine and boot using cdrom.
3. At the installation option menu, type "linux rescue", follow the instruction (some distribution will mount the partitions on c automatically) and you will reach a shell prompt.
4. If partition is not automatically mounted, you will need to
mkdir /temp/mnt
then do a "mount $PATHTOYOURDEV /temp/mnt"
5. vi the /temp/mnt/etc/passwd, check for the root entry .. either add/modify the line .. which should look something like this.
root:x:0:0:root:/root:/bin/bash
6. vi the /tmp/mnt/etc/shadow, insert/modify to this entry
root::::::::
*note the number of colon is essential, in both entry.
7. Logout and reboot. Remove all installation media.
8. Boot to single user mode and change password.
by alveden
by gregberry
by pj
Inserrt the installation CDs, then upgrade the system, it will ask for the root password and create the root user again.
If this is not possible, try to log-in ain standalone mode (if it is possible) and creat a user with userid 0.
If that doesn'twork try opening the /etc/passwd and /etc/shadow /etc/security/shadow /etc/security/passwd and copy the content of another machine root user in them.
Regards.-
Pablo.-
by gregberry
quite simple,
Insert o/s cd,
boot cdrom -sw
create a directory or find one that is empty and
mount root partition in that directory.
cd into the etc directory.
set TERM and CRT variable
vi etc/shadow or etc/passwd depending on the o/s and remove the root password or re-create it.
reboot.... et voila!!!
by gregberry
by gregberry
This discussion is closed to new replies.
Trending Linux posts
Sort by Trending