trying to change solaris root password using single user shell - not working

hi - the root password has been lost on a fairly important box in my company. i have tried to chagne as per below method but cant - it mentions the file is read only. am i missing something?

When you boot from the CD, select the option for the Sigle-user mode (Option 6 on Solaris 10 CD)

This will look for the currently installed Solaris OS on your system and prompts a Yes/No question to mount the Root filesystem as a Read/Write file system onto /a.

Select yes to mount the root file system (/dev/dsk/c0t0d0s0 here) on /a. If you select No, no harm as you still can mount it manually using:

mount /dev/dsk/c0t0d0s0 /a

NOTE: /a is a temporary mount point that is available when you boot from CD or a JumpStart server

Now, with the root file system mounted on /a. All you need to do is to edit the shadow file and remove the encrypted password for root.

# vi /a/etc/shadow

Now, exit the mounted filesysten, unmount the root filesystem and reboot the system to single-user mode booting of the disk.

# cd /

# umount /a

# init s
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

Before starting "vi" run:

export TERM=vt100

and, afrer making changes, save the file with


(Note te exclamation point!)

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
MongolianNoseFluteAuthor Commented:
Thanks - I tried that but it returned the error below:
TERM=vt100 is not an identifier
MongolianNoseFluteAuthor Commented:
ok - we used another method and i see a string next to root:


do i remove everything after root: or leave some of it?
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

Remove everything after "root:"  up to the next colon (:), leaving both colons intact.
The result should look like


Strange thing that "export" should not have worked. You have ksh (or bash), don't you? I was rather sure that "ksh" is Solaris' default shell.


setenv TERM vt100

should have been worth a try.
If somehow you can't set the terminal, you can look up instructions on how to use the ed line editor.
Joseph GanSystem AdminCommented:
Try this in command line:
ok> boot cdrom -s
# mount /dev/dsk/c0t0d0s0 /a
# TERM=xterm; export TERM
# /usr/openwin/bin/resize
# vi /a/etc/shadow
Been a while but try editing a copy then overwrite e.g.

cp /a/etc/shadow /tmp/shadow
chmod +w /tmp/shadow
vi /tmp/shadow
cat /tmp/shadow >  /a/etc/shadow

Open in new window

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.