Solved

Changing the root password in Solaris 8

Posted on 2003-10-29
16
14,862 Views
Last Modified: 2013-12-27
I have a Sun Solaris 8 computer in my department that has had the root password changed,
and I can not login.

How can I get the password changed.

If you could explain it by doing it at the computer level and if possible over the network.  
0
Comment
Question by:CMILLER
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 4
  • +2
16 Comments
 
LVL 24

Expert Comment

by:shivsa
ID: 9645047
install the sudo from Sun.

once it is installed u can be root and then change the root password.
0
 

Author Comment

by:CMILLER
ID: 9645589
I can not log in to the machine at all, I have no account
0
 
LVL 34

Expert Comment

by:PsiCop
ID: 9646069
You can't tackle this from over the network. You need to be AT the machine - besides, even if you knew the password, by default Solaris v8 will not allow root to login from anywhere except the console. I'm going to assume (since you didn't bother to say) its a Sun/Sparc CPU with a Sun keyboard attached. This goes differently from an Intel box running Solaris for x86.

1) Press and hold the STOP key and then press A. You will enter the Open Boot PROM (OBP) monitor, denoted by the "ok" prompt.
2) Insert the Solaris v8 CD-ROM (disk 1 of 1) into the CD-ROM drive
3) Type "boot cdrom" and hit ENTER
4) The Solaris install will start. Select a language and local and all that stuff and let it get to the GUI interface.
5) Abort the install but remain in the GUI. Using the console window, mount the drive slice containing the root partition. For example, you might type "mount /dev/dsk/c0t0d0s0 /mnt"
6) Change directory to the root partition's /etc directory (in my example, that would be /mnt/etc)
7) Using ex or even cat if you have to, edit the shadow file to blank out the password for root
8) After saving the change, reboot the machine

The root account now has no password - you can login and establish one.
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 38

Accepted Solution

by:
yuzh earned 125 total points
ID: 9646964
When you don't have the root password, you have to go to the console to do the job.

In you case, you need to go to the console to do the job. (you can boot up from a boot
server if you have one, or boot up from a Solaris software CD in single user mode, then
get rid of the passwd), here's what you need to do:

<Stop> A

boot cdrom -s
(or boot net -s)

fsck -y /dev/rdsk/c0t0d0s0
mount /dev/dsk/c0t0d0s0 /a
TERM=sun
export TERM
vi /a/etc/shadow
and remove the encrypted password entry for root.
umount /a

then reboot the system and reset the root password.
0
 

Author Comment

by:CMILLER
ID: 9647135
Thanks for all sug, I am in the process of trying all of them, so far today I have not been unable to boot to the cdrom to try these sug.

Sorry to all, That I didnt explain if it was a Sun/Sparc CPU with a Sun keyboard attached or an Intel box running Solaris for x86.

Comments like this: (since you didn't bother to say) was that really necessary!!

Back to the problem: It is a SunBlade 100 and I am using the Solaris 8 software that came with a Ultra 5, can you see any reason that it wont boot to the cdrom. I did reset the system defaults.

I came here after these had been bought and no one knows where the original software is, that is if they even bought a software kit.

I wont be back in the office until next Monday, and I will try again.

Thanks
0
 
LVL 38

Expert Comment

by:yuzh
ID: 9647395
If it is a SunBlade 100, you need to use Solaris 8 Software 2/02 or newer version
to boot it up. (for Ultra 5, any Solaris 8 release CD will work)

Just in case, your CD can not boot up your SunBlade 100, you can alway download
the Solaris 9 (SPARC) from (FREE):

http://wwws.sun.com/software/solaris/binaries/get.html

IF you are using Solaris x86, you need to use the "Solaris Installation" CD not the
"Soaris Software" CD. (it will automaticall boot up in single user mode!)
0
 
LVL 16

Expert Comment

by:Hanno P.S.
ID: 9658455
You can always boot from the "Solaris Software - 1 of 2" CD using

- Press <Stop>-A at the consoel or send a BREAK when using a serial terminal.
- Now you can boot into single user with
  boot -s  (SPARC)
     or
  b -s       (x86 PC)
- Check your root fs (usually slice 0 on SCSI target 0) with fsck /dev/rdsk/c0t0d0s0
- Mount the root fs with mount /dev/dsk/c0t0d0s0 /a
- Set your TERM variable
   TERM=sun
     or
  TERM=vt100
- vi /a/etc/passwd and remove the encrypted password for root
- umount /a
- halt
- and reboot
- Now you can log in with empty root password.

Cheers

0
 
LVL 34

Expert Comment

by:PsiCop
ID: 9658579
I thought that's what I suggested.
0
 
LVL 16

Expert Comment

by:Hanno P.S.
ID: 9658623
... but not single user mode ;-)
0
 
LVL 34

Expert Comment

by:PsiCop
ID: 9658973
He stated he doesn't have the root password and you need the root password to get into single-user mode.
0
 
LVL 16

Expert Comment

by:Hanno P.S.
ID: 9662280
No, you don't need it when booting from CD
0
 
LVL 34

Expert Comment

by:PsiCop
ID: 9670865
Ah, I get what you meant. Sorry, just a little slow with this cold.
0
 
LVL 38

Expert Comment

by:yuzh
ID: 9671060
For Solaris X86:
b instead of boot
fsck -y /dev/rdsk/c0d0s0
mount /dev/dsk/c0d0s0 /a

I thought we were talking about Sun box (Sparc platform!)
0
 

Author Comment

by:CMILLER
ID: 9682346
yuzh,
I downloaded Sol9 and it will boot to the cdrom.
I folowed the instructions, when I reboot and get to the logon screen,
I put in " root " and hit enter, it will work for a second and go back to the logon screen.
It never gets to the password screen.

I removed the whole line, all that is left in the shadow file for root is:

root:

There are other entreies for other users
***********************************************
JustUNIX,

when I went into the passwd file, here is what was there,

root:x:0:1:Super-User:/:/sbin/sh
0
 

Author Comment

by:CMILLER
ID: 9683103
yuzh,
I figured out what I did, I deleted everything from the root: line in the shadow file,
I should have only deleted in between the :: .

There was another login that someone had created " toor ", I deleted in between the ::
and was able to login and also change the " root " password.

Thanks

0
 
LVL 16

Expert Comment

by:Hanno P.S.
ID: 9699667
user toor: that looks like a "backhole" for root ;-)

I'm _very_ sorry that I wrote to change the password entry in /etc/passwd
when I meant to change it in /etc/shadow. Please forgive my misleading
suggestion :-(
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question