Solved

Changing the root password in Solaris 8

Posted on 2003-10-29
16
14,807 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
  • 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
 
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 Schröder
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 16

Expert Comment

by:Hanno Schröder
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 Schröder
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 Schröder
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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.

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now