Visit Our UNIX and Linux User Community


Recovering Solaris 8 root password


 
Thread Tools Search this Thread
Operating Systems Solaris Recovering Solaris 8 root password
# 1  
Old 03-29-2012
Recovering Solaris 8 root password

Hello everyone, i'm trying to recover my root password on a Solaris 8 O.S.

I've been trying the next steps(obviously in order) on and on:

1. Inserting the CD-ROM
2. Typing boot cdrom -s
3. Trying to execute fsck -y /dev/dsk/c0t0d0s0. When executing this, I get the following error: can't stat c0t0d0s0.
4. After this I run the following statement: ls /tmp/dev/dsk and a'lot of c10* files are displayed. I finally "fscked" one and mounted it on /a. But the shadow file located in etc is not displaying the users with the encrypted passwords, instead it only shows a path which is "../var/run/sys_logd" or something.



Any ideas? Any help will be fully appreciated Smilie

Last edited by alvaradogunner; 03-30-2012 at 03:42 PM..
# 2  
Old 03-29-2012
Are you sure /dev/dsk/c0t0d0s0 is the disk/slice your root filesystem is on?
This User Gave Thanks to fpmurphy For This Post:
# 3  
Old 03-29-2012
hello fpmurphy, first of all, thanks for replying.

I'm not sure if /dev/dsk/c0t0d0s0 is the slice in which my root file system resides. How can I find the slice in which my file system resides in?



Any ideas or comments? Smilie

Last edited by alvaradogunner; 03-30-2012 at 02:08 AM..
# 4  
Old 03-30-2012
Hi,
Follow the procedure to " Delete and Reset a Lost Root Password" --

1) Insert the Solaris[TM] 2.x Operating System CD-ROM into the
CD-ROM drive. For the Solaris 8 Operating System (Solaris 8 OS),
this CD-ROM is disk 1 of 2.

2) Once the CD-ROM is in the drive, perform a stop-a. This brings
the system down to the "ok" prompt.

3) From the "ok" prompt, perform a single-user boot from the Solaris OS CD-ROM.

ok boot cdrom -s

4) At the "#" prompt, determine which disk is the system's boot
disk (containing the root file system). There are several Sun
architectures and various configurations of systems when it
concerns a boot disk. As a general rule, most boot disks are
attached to controller 0 (c0). Usually, their SCSI target is
either 3 (t3) or 0 (t0). However, Sun machines are very flexible,
and the boot disk could be at a different location. If
you are not sure which disk is your boot disk, perform the
following steps to determine the location of the boot device:

a) # eeprom boot-device

The output might appear to be simple, such as "disk" or "disk1" or more complicated, such as a pathname

"/iommu/sbus/espdma@4,8400000/...../sd@3,0:a".

b) Make note of the boot-device. If the boot-device is a pathname, it is beyond the scope of this information to provide the location of the customized boot disk. However, for most configurations, finding the customized boot disk is an easy task. The "Format" command shows all available disks:

# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t0d0 <ST34321A cyl 8892 alt 2 hd 15 sec 63>
/pci@1f,0/pci@1,1/ide@3/dad@0,0
Specify disk (enter its number):

c) Enter <cntrl>d to exit format.

Now, you will have an idea what disks are on the system. Therefore, if the boot-device is "disk" and format shows "c0t0d0" (on some systems "c0t3d0") then that is the boot device. If boot-device shows "disk1" and format shows "c0t1d0," then that is the boot device. If format shows multiple disks, then based on what the "eeprom boot-device" command shows, the system's boot disk would be:

boot-device format

disk c0t0d0 or c0t3d0 (machine dependent)

disk1 c0t1d0

disk2 c0t2d0

disk3 c0t3d0 or c0t0d0 (machine dependent)

and so on ....

5) Because the system was not brought down gracefully (no root password means having to use the Stop-a keystroke to "crash" the system), you need to run "fsck" to clean the root partition (slice). The fsck also confirms that you selected the proper slice.

# fsck /dev/rdsk/cXtYd0s0

where the X and Y are determined by the previous procedure.

It is also possible to have a root partition which is not on slice 0 (s0), but, again, that is not a standard configuration.

The output of "fsck" looks like this:

** /dev/rdsk/c0t0d0s0
** last mounted on /
** Phase 1 .....
.....

The second line in the output of "fsck" ("** Last mounted on /")
confirms that this is the correct root filesystem partition. Answer "y" to any questions fsck asks. There shouldn't be too many items needing repair. If there are, there is a possibility of a corrupted root filesystem. After fsck is finished, mount the root partition:

# mount /dev/dsk/cXtYd0s0 /a

Again, X and Y are the same as for the fsck command.

For example:

# mount /dev/dsk/c0t0d0s0 /a

6) From the root prompt, set the proper TERM type command
(such as vt100, dtterm, sun, and so on) by entering this command:

# TERM=sun; export TERM

7) Use the VI text editor to edit the /etc/shadow file:

# vi /a/etc/shadow
This User Gave Thanks to sunadmin For This Post:
# 5  
Old 03-30-2012
hello sunadmin, thanks for replying.

I executed the format command, and displayed the following:

Quote:

AVAILABLE DISK SELECTIONS:

0. c1t0d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
/pci@8, 600000/SUNW, q1c@4/fp@0, 0/ssd@w21000004cfef8bff,0


1. c1t1d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
/pci@8, 600000/SUNW, q1c@4/fp@0, 0/ssd@w2100002037fd3d50,0


2. c1t8d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
/pci@8, 600000/SUNW, q1c@4/fp@0, 0/ssd@w210000203742463e,0


3. c1t9d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
/pci@8, 600000/SUNW, q1c@4/fp@0, 0/ssd@w2100000c50106ba2,0

4. c1t10d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
/pci@8, 600000/SUNW, q1c@4/fp@0, 0/ssd@w21000004cfd99304,0


5. c1t11d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
/pci@8, 600000/SUNW, q1c@4/fp@0, 0/ssd@w21000004cfd99ad6,0




eeprom boot-device displayed the next info:
Quote:


boot-device=/pci@8,600000/SUNW,q1c@4/fp@0,0/disk@w21000004cfef8bff, 0: a disk

eeprom information matches with the first disk1 showed by the format command, so this means that my file system resides on disk1.

I did a fsck on /dev/rdsk/c1t0d0s0 and mounted in on /a:

Quote:
fsck -y /dev/rdsk/c1t0d0s0

mount /dev/dsk/c1t0d0s0
I also set my TERM variable to sun and exported it:

Quote:
TERM=sun
export TERM
I opened the /a/etc/shadow file but it is not displaying any information about passwords. It displays the following:

Quote:
../var/run/syslog_door

"/a/etc/shadow" 1 line, 464 characters ( 441 null )
Any suggestions? Smilie

Last edited by alvaradogunner; 03-30-2012 at 01:59 PM..
# 6  
Old 03-30-2012
Your /etc/shadow file got corrupted. Do you have backups?
This User Gave Thanks to jim mcnamara For This Post:
# 7  
Old 03-30-2012
First check that the passwd and shadow files look like files:
Code:
ls -lad /a/etc/passwd
ls -lad /a/etc/shadow

Just in case vi is misbehaving, just check whether the file is readable:
Code:
head -1 /a/etc/shadow

Just in case this is a Sunos without /etc/shadow, please look at the first line of /a/etc/passwd:
Code:
head -1 /a/etc/passwd

If the field after root: contains several random characters, that's the password to remove. Do save a copy of the passwd file first.

Last edited by methyl; 03-30-2012 at 03:15 PM..
This User Gave Thanks to methyl For This Post:

Previous Thread | Next Thread
Test Your Knowledge in Computers #848
Difficulty: Medium
The IEEE standardized Bluetooth as IEEE 802.15.1, but IEEE no longer maintains the Bluetooth standard.
True or False?

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

I have forgot my root password. Solaris 10

hi everyone i have forgot my root password and i have other user to login. can i get the password without restarting the server as that cant be afforded. . it is a Sparc architecture 2U blade server. it is old server mounted and functional since 2009. what should be the modus oprandee. i am novice... (5 Replies)
Discussion started by: janakors
5 Replies

2. UNIX for Beginners Questions & Answers

Can a root role change the root password in Solaris 10?

i do not have root on a solairs 10 server , however i do have the root role, i was wondering if I can change the root password as a a role with the passwd command? I have not tried yet. and do i have to use the # chgkey -p afterwards? i need to patch is why i am asking. thanks (1 Reply)
Discussion started by: goya
1 Replies

3. Solaris

How recover the root password - Solaris 11?

Hello forum members, Please help me to recover the root password. I have had difficulties working with Solaris 11. The run-level equivalents single-user in Solaris 10, I can mount disk in one partition and edit files shadow/passwd. For example: {0} ok boot cdrom -s # mount... (4 Replies)
Discussion started by: Marcela Bueno
4 Replies

4. Solaris

solaris 8 reset root password from OSX

Hello, I have two old Solaris machines $ uname -a SunOS unknown 5.8 Generic_117350-39 sun4u sparc SUNW,UltraAX-e2 unfortunately, it has been so long ago that i have used these that the root password has left my head... i can log into one of the machine as a normal user, but am unable to... (4 Replies)
Discussion started by: Norman Khine
4 Replies

5. Solaris

Can't change root password in solaris express 11

How do I change root password in SolarisExpress 11? I used passwd while elevated to root and all it changes is the password of the user I am logged in, not te root password. (2 Replies)
Discussion started by: taltamir
2 Replies

6. Solaris

install eclipse under solaris without root password?

hi, Ho can I install eclipse under solaris without root password? Thanks. peter (1 Reply)
Discussion started by: laopi
1 Replies

7. Solaris

Solaris 8 - Asks for current root password when trying to change root password.

Hello All, I have several solaris boxes running Solaris 8. When changing root passwords on them, all will simply ask for the new root password to change and of course to re-type the new password. One of the systems however asks for the existing root password before it will display the new password... (8 Replies)
Discussion started by: tferrazz
8 Replies

8. Solaris

Solaris root password

Bit of a strange problem I have never come across before.. I can log into the workstation going through the server as it is a trusted host but when I try and connect to the workstation through SSH or RSH directly it will not take the password, I changed the password when I logged in the machine... (5 Replies)
Discussion started by: Mr Pink
5 Replies

9. Solaris

How to set Root password age limit in Solaris 9/10

Hi Friends, Can anyone tell me how can I set the password age limit for root user to 14 days....??? Also would like to add following for root password; min-alpha --- 4 min-other --- 1 min-length -- 6 min-diff ----- 3 How can I do these on command line....??? Regards, jumadhiya (7 Replies)
Discussion started by: jumadhiya
7 Replies

Featured Tech Videos