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?
Before starting "vi" run:

export TERM=vt100

and, afrer making changes, save the file with


(Note te exclamation point!)
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?
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

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

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.