Resetting the root password on a Solaris server

I had to use the following step to reset a the root password on a Solaris system the other day. You will need physical access to the system to use these steps.

  1. Press Stop-A on the console or Ctrl-] and send brk from a remote console connection to access the Open Boot PROM (OBP).
    NOTE : If you are using TeraTerm-Pro, you send a break from the menu.
  2. Insert a bootable Solaris CD/DVD and boot into single-user mode with boot cdrom -s
    If a JumpStart boot server is located on the system’s subnet, and the system was properly configured for JumpStart, you may instead boot over the network into single-user mode with boot net -s
  3. Make a mount point within the /tmp file system by typing mkdir /tmp/mnt
  4. Mount the root partition of your boot disk in /tmp/mnt
    e.g. #> mount /dev/dsk/c0t0d0s0 /tmp/mnt

    NOTE : To check the device name use the format command.

  5. Edit /etc/shadow with TERM=vt100 vi /tmp/mnt/etc/shadow
  6. Remove the encrypted part of the root password (the second field; fields are separated by colons), save, and exit.
  7. Unmount the file system with umount /tmp/mnt
  8. Reboot the system and assign a new password at a shell prompt with the passwd command.

If you are unable to run vi above, you can edit /etc/shadow using the ed editor.

# ed /tmp/mnt/etc/shadow
1p
s/:………….:/::/ (Note: there are 13 dots in the second field)
1p
w
q

Manually Mount a local or remote CDROM in Sun Solaris

by ¯/¯ / /\/

I recently went to try and install Oracle 10g on a Solaris 10 server, and for some reason it wouldn’t recognize the DVD when I put it in the drive. Solaris and UNIX machines in general I think and usually good for this sort of thing. You put a CD in the drive, it detects it, and puts an icon on your desktop for the new CD or at least mounts it to something like /cdrom or /media/cdrom for you.

However, this machine on this particular day, wasn’t playing ball. So I had to figure out how to do it manually.

Here’s what I did.

Read More »

Adding Second IDE Hard Drive into a Sun Server

Image by isdky
Image by isdky

I had to add an IDE hard drive into a Solaris server the other day and couldn’t remember all the commands you need to use to get the system to see the new drive, partition it and format it.

But luckly I found a very helpful page over at http://www. idevelopment.info called Adding Second IDE Hard Drive into a Blade 100/150

As it turns out I wasn’t adding a drive into a Blade 100 server, but all the commands i needed were there and I got it going.

fsck guide

Image by Karsoe
Image by Karsoe

Over in the Sun General Maintenance forms I found a good thread on the uses of fsck called fsck best practises guide. While I wouldn’t necessarily take it as a be all and end all manual on how to use fsck. It does make a good guide or starting point.

You must judge when and how to use fsck yourself given your environment and the scope of the problem you are experiencing.