Computing.Net > Forums > Unix > I lost root passwd for Solaris

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

I lost root passwd for Solaris

Reply to Message Icon

Name: William Garcia
Date: November 13, 2000 at 11:25:27 Pacific
Comment:

I lost the root password for a Solaris machine. I have access with one user id, but it doesn't have permissions to change passwd or to perform new users.
If someone knows some clue to solve this problem...Thanks a lot...



Sponsored Link
Ads by Google

Response Number 1
Name: Manish
Date: November 17, 2000 at 02:35:21 Pacific
Reply:

Hi William

Yo hv not mentioned ur platform, whether
u r using SUN or intel hardware..?

If U r using SUNsparck thn do the following
go to OBP prompt ( either by shutdown or by
pressing stop+a...but second method risks the
loss of data, do sync on ok prompt)
now get ur original solaris CD-ROM and boot
the machine with following command
boot cdrom -s
it will directly giv yo # prompt
now creat one directory in root by some name
mount your root (/) partition on the dirctory
just created using
mount / /directoryname
now edit the /etc/shadow file and remove all
the characters between second colon (:) and third colon, save the file....unmount /
give init 6
login as root, it wont ask you the password
set new password using passwd command.
thts it....feel free to mail me in case of
problem.


0

Response Number 2
Name: Web Genius
Date: December 23, 2000 at 23:56:36 Pacific
Reply:

How to recover a lost or forgotten password Solaris.
If you have lost or forgotten the root password on your Sun Sparc system here are some instructions for regaining control of the system.
You will need a cdrom drive and a Solaris installation cdrom. Just to be safe make sure the installation cdrom is equal to, or later than, the OS release on the hard disk.
If the system is not halted then halt the system by pressing Stop-A. This will bring you to the ok prompt.
Place the installation cdrom in the cdrom drive. Boot the system to single user mode using the cdrom drive. Type

boot cdrom -s

It may take a while but you will automatically be logged in as root in single user mode running the OS from the cdrom.
If you had to force halt the system, by pressing Stop-A for instance, then the partitions on the hard disk will not be marked as being shutdown cleanly. So I recommend running fsck on the root partition.

e.g. fsck -y /dev/dsk/c0t3d0s0

Now c0t3d0s0 is just the root partition in this example. Please verify your boot disk.
Now mount the root partition. The cdrom has created a directory a for mounting hard disks. So type

mount /dev/dsk/c0t3d0s0 /a
The next step is to remove root's password. Using your favorite editor, edit /a/etc/shadow. Find root's entry in the file and make the second field null. Colons are the field delimeters. So your entry, after changes, should look something like

root::10565::::::

Various fields will be used if certain parameters have been set for the OS.
Now boot to single user mode using the hard disk.

reboot -- -s

NOTE: that is reboot space hyphen hyphen space hyphen s.
You can login as root without a password and set root's password using the passwd command.
Finally, exit single user mode and let the system continue booting to multi-user mode.
I recommend rebooting to single user mode first because if the system is set to not allow null passwords you may not be able to login as root with a null password in multi-user mode.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: I lost root passwd for Solaris

Where can I download the suidperl for solaris 7 ? www.computing.net/answers/unix/where-can-i-download-the-suidperl-for-solaris-7-/1562.html

lost root password www.computing.net/answers/unix/lost-root-password/1726.html

lost root password for IRIX6.5 www.computing.net/answers/unix/lost-root-password-for-irix65/1826.html