Changing the root password in Solaris 8

I have a Sun Solaris 8 computer in my department that has had the root password changed,
and I can not login.

How can I get the password changed.

If you could explain it by doing it at the computer level and if possible over the network.  
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

install the sudo from Sun.

once it is installed u can be root and then change the root password.
CMILLERAuthor Commented:
I can not log in to the machine at all, I have no account
You can't tackle this from over the network. You need to be AT the machine - besides, even if you knew the password, by default Solaris v8 will not allow root to login from anywhere except the console. I'm going to assume (since you didn't bother to say) its a Sun/Sparc CPU with a Sun keyboard attached. This goes differently from an Intel box running Solaris for x86.

1) Press and hold the STOP key and then press A. You will enter the Open Boot PROM (OBP) monitor, denoted by the "ok" prompt.
2) Insert the Solaris v8 CD-ROM (disk 1 of 1) into the CD-ROM drive
3) Type "boot cdrom" and hit ENTER
4) The Solaris install will start. Select a language and local and all that stuff and let it get to the GUI interface.
5) Abort the install but remain in the GUI. Using the console window, mount the drive slice containing the root partition. For example, you might type "mount /dev/dsk/c0t0d0s0 /mnt"
6) Change directory to the root partition's /etc directory (in my example, that would be /mnt/etc)
7) Using ex or even cat if you have to, edit the shadow file to blank out the password for root
8) After saving the change, reboot the machine

The root account now has no password - you can login and establish one.
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

When you don't have the root password, you have to go to the console to do the job.

In you case, you need to go to the console to do the job. (you can boot up from a boot
server if you have one, or boot up from a Solaris software CD in single user mode, then
get rid of the passwd), here's what you need to do:

<Stop> A

boot cdrom -s
(or boot net -s)

fsck -y /dev/rdsk/c0t0d0s0
mount /dev/dsk/c0t0d0s0 /a
export TERM
vi /a/etc/shadow
and remove the encrypted password entry for root.
umount /a

then reboot the system and reset the root password.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CMILLERAuthor Commented:
Thanks for all sug, I am in the process of trying all of them, so far today I have not been unable to boot to the cdrom to try these sug.

Sorry to all, That I didnt explain if it was a Sun/Sparc CPU with a Sun keyboard attached or an Intel box running Solaris for x86.

Comments like this: (since you didn't bother to say) was that really necessary!!

Back to the problem: It is a SunBlade 100 and I am using the Solaris 8 software that came with a Ultra 5, can you see any reason that it wont boot to the cdrom. I did reset the system defaults.

I came here after these had been bought and no one knows where the original software is, that is if they even bought a software kit.

I wont be back in the office until next Monday, and I will try again.

If it is a SunBlade 100, you need to use Solaris 8 Software 2/02 or newer version
to boot it up. (for Ultra 5, any Solaris 8 release CD will work)

Just in case, your CD can not boot up your SunBlade 100, you can alway download
the Solaris 9 (SPARC) from (FREE):

IF you are using Solaris x86, you need to use the "Solaris Installation" CD not the
"Soaris Software" CD. (it will automaticall boot up in single user mode!)
Hanno P.S.IT Consultant and Infrastructure ArchitectCommented:
You can always boot from the "Solaris Software - 1 of 2" CD using

- Press <Stop>-A at the consoel or send a BREAK when using a serial terminal.
- Now you can boot into single user with
  boot -s  (SPARC)
  b -s       (x86 PC)
- Check your root fs (usually slice 0 on SCSI target 0) with fsck /dev/rdsk/c0t0d0s0
- Mount the root fs with mount /dev/dsk/c0t0d0s0 /a
- Set your TERM variable
- vi /a/etc/passwd and remove the encrypted password for root
- umount /a
- halt
- and reboot
- Now you can log in with empty root password.


I thought that's what I suggested.
Hanno P.S.IT Consultant and Infrastructure ArchitectCommented:
... but not single user mode ;-)
He stated he doesn't have the root password and you need the root password to get into single-user mode.
Hanno P.S.IT Consultant and Infrastructure ArchitectCommented:
No, you don't need it when booting from CD
Ah, I get what you meant. Sorry, just a little slow with this cold.
For Solaris X86:
b instead of boot
fsck -y /dev/rdsk/c0d0s0
mount /dev/dsk/c0d0s0 /a

I thought we were talking about Sun box (Sparc platform!)
CMILLERAuthor Commented:
I downloaded Sol9 and it will boot to the cdrom.
I folowed the instructions, when I reboot and get to the logon screen,
I put in " root " and hit enter, it will work for a second and go back to the logon screen.
It never gets to the password screen.

I removed the whole line, all that is left in the shadow file for root is:


There are other entreies for other users

when I went into the passwd file, here is what was there,

CMILLERAuthor Commented:
I figured out what I did, I deleted everything from the root: line in the shadow file,
I should have only deleted in between the :: .

There was another login that someone had created " toor ", I deleted in between the ::
and was able to login and also change the " root " password.


Hanno P.S.IT Consultant and Infrastructure ArchitectCommented:
user toor: that looks like a "backhole" for root ;-)

I'm _very_ sorry that I wrote to change the password entry in /etc/passwd
when I meant to change it in /etc/shadow. Please forgive my misleading
suggestion :-(
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.