Discussion Locked

Sun Root password

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am new to sun boxes and have the following dilemma.

I'm currently working on a SUN ultra 1 box and don't have the root password or any password for that matter. Is there a way for me to obtain the password or change it. I have tried to run the single user session but it still prompts me for the root password. Software is Sun Solaris 2.6

Thanks,
Jon Isett
jdisett@ssu.edu

6 replies

by shanghai sam

boot the system with the solaris cd and mount the root drive to /a (i think it is /a). Then you can edit the /a/etc/shadow file and then cut and paste the encrypted password you know on the server (like the one you logon with). then reboot normally.

ie.

root:xxxxxxxxxxx:6445::::::
user:yyyyyyyyyyy:11231::::::

would be

root:yyyyyyyyyyy:11231::::::
user:yyyyyyyyyyy:11231::::::

make sure you copy the number after the encrypted password.

by shanghai sam

Boot from the cdrom in single user mode by doing the following:

hit the -A keyboard sequence
put the cd in the cdrom drive
you will see a prompt that says "ok"

type:
boot cdrom -s

This will boot from the cdrom drive to the single user mode without making you type in a password.

once you are in the single user mode, you will have to find out what drive/partition your root file system is located on. I would guess that it would be /dev/dsk/c0t0d0s0, but it could be any number of drive/slice combinations. I would recommend using the "format" command to see what drives you have, and what the partition layout is for them.

once you have a guess at what the drive and slice numbers are, you should mount them using the following command:

mount -F ufs /dev/dsk/c#t#d#s# (I would try /dev/dsk/c0t0d0s0 first as that is usually pretty standard).

if that mounts cleanly, check to see if there is an etc directory in the filesystem by doing an ls on /mnt. if etc exists in there, you will have to edit the /mnt/etc/shadow file.

by cpfeiffe

Both responses were correct in telling you to boot into single user mode from CD and mount the root file system. But it sounds like you just need to erase the root password and are having trouble doing that. In the shadow file erase the second field (root:cryptedpassword:::::). Erase what is between the first and second colon, leaving both colons. Then you can reboot the machine normally, login without a password and use the passwd command to set a root password.

by ghislain.levesque

boot cdrom -sw
mount /dev/dsk/c0t0d0s0 /a
TERM=vt100
vi /a/etc/shadow
and modify the root entry
FROM: root:qw45t56tr:........
to : root::..........
save the file
and reboot

Now root has no password...

Have fun

by dattatray_b

Pl. follow the following procedure :-

1)power on the machine, when I will start the memory test press ctrl + break (if u r having VT100 series console ) or stop + A ( if having Sun Key board.) then insert the sun O.S. cdrom in to cd Drive and type boot cdrom -s the machinf will boor from cdrom in single user mode.

2) it will come to the # prompt then mount the root file system of the O.S. Disk.

3) go to /etc. vi the shadow and del the chara. from passwd field save it.

4) boot the machine and login as root. it will not ask u for passwd..

regards

Dattatray v. Bhagwat

by let

When the machine is up, record the / disk
device by doing a df -k /

Insert the solaris 2.6 OS cdrom.

At the boot prompt type
boot cdrom -s

The machine will boot to single user mode off the cdrom (no password).

create a mount point
mkdir /tmp/root

mount the hard drive root file system to the mount point
mount /dev/dsk/

cd /tmp/root/etc
(your now in the etc of the hard disk), vi the passwd and shadow files to remove the root password.
cd /
umount /tmp/root
reboot

This discussion is closed to new replies.