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
20150508-155852.jpg
MongolianNoseFluteAsked:
Who is Participating?
 
woolmilkporcCommented:
Before starting "vi" run:

export TERM=vt100

and, afrer making changes, save the file with

:wq!

(Note te exclamation point!)
0
 
MongolianNoseFluteAuthor Commented:
Thanks - I tried that but it returned the error below:
TERM=vt100 is not an identifier
0
 
MongolianNoseFluteAuthor Commented:
ok - we used another method and i see a string next to root:

$asdf.1AH.MJ3sivd4$YFoFnasdf4cZW9H6G6cbT4.1VBmasdfmv.a0wCU/i3zEFasdfasdf4W.:15843:0:99999:7:::

do i remove everything after root: or leave some of it?
0
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.

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

root::15843:0:99999:7:::  

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.

Anyway

setenv TERM vt100

should have been worth a try.
0
 
serialbandCommented:
If somehow you can't set the terminal, you can look up instructions on how to use the ed line editor.  https://www.gnu.org/software/ed/manual/ed_manual.html
0
 
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
.......
0
 
arober11Commented:
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

0
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.