Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

No Root/ No User Account / No experience :(

Status
Not open for further replies.

zarufa

Technical User
Jan 23, 2002
22
US
I just got an old HP 9000 712/100. I got it too learn unix and to setup as a server. There is a problem though, it got it in all the orignal packageing and everything but there was already a password for root and what ever accounts are on it. Like I said I dont have alot of experience with it all. If anyone has any suggestions please let me know. Thank You.

Nathan
 
I would suggest a complete re-install of the operating system. Do you have the software ?

You could just load miniroot from your OS media and then reset the root password, but as you dont know the history of th emachine its probably best to trash it and do a re-install.
 
I need to get a box to play with.

Where did you get it from and how much did you pay for it?

Thanks.
 
I do have the OS, although it didnt come with a CDrom, it just has the 3 1/2, I could see if I could the Could get it, but Im not completely sure that will be possible.

I actually got it for free, one of my freinds work was getting rid of allot of stuff for tax write off. ALthough if you check ebay, the model I have is pretty cheap.

Any other suggestions out there, thanks for the help.

- Nathan
 
Sorry let me clear that up a little. I dont have the CD reader, all I have is a 3 1/2 in it. I do have the OS that is on the CDROM, so any ideas on how I could just reset or do anything. It wouldnt matter if the accounts on there died or anything. Thanks for any help that any of you can provide.

- Nathan
 
Hello zarufa / Nathan ,

To reset your root password and to allow you to login to your Hp-9000 712/100
,you can try to perform the following instructions .
( Since You do not have acess to CDROM Device )

a.) Power off your Hp-712
b.) Power on you Hp-712
C.) Press "Esc" key when you see the Hp-logo screen .
You can type Esc key as many times as you want . This will bring you
interactive mode .
Wait..... for awhile . You will get the Boot_Admin promt
d.) Type Boot pri isl , as shown below :

Boot_Admin > Boot pri isl

e.) Type hpux -lm , as shown below

ISL > hpux -lm

f.) Type the following at the # prompt , as shown below

# vgchange -a y /dev/vg00
# mount /usr
# cp /etc/passwd /etc/passwd.old
# awk -F":" ' $1 ~ /root/ { print $1":"$3":"$4":"$5":"$6":"$7 }' /etc/passwd.old > /etc/passwd
# awk -F":" ' $1 !~ /root/ { print $0 } ' /etc/passwd.old >> /etc/passwd
# reboot

Please remember that the "awk" command has double quotes such as " and single
quote ' . The single quote is just beside your Enter key.

If you have any problems , let me know .

Rgds , omari






 
Hi Omari,

Did you forget a second ":" in your awk statement? Where the first and second "::" together indicate a blank password for root?

i.e.

awk -F":" ' $1 ~ /root/ {print $1"::"$3":"$4":"$5":"$6":"$7}' /etc/passwd.old > /etc/passwd

 
Thank You very much for your help, I will try what you said and let you know how it goes. Thanks.

Nathan
 
It worked......kinda....sorta...Im not sure. Well Not all the commands worked, some did, some didnt, it booted a little different, I had to pick a mode, I went with S which ended up being single user. When I reboot, it came up with no root password, no user password. THen it droped me to the #prompt with a warning that says "waring, you are a superuser"

Im not quite sure where to go from there. Thanks all the help so far.
- Nahan
 
When you get the warning that you are super user, that means you can set root's password. Then boot into multi-user and clean up the rest of the password file.

You might want to view the /etc/passwd file before you boot into multi-user and see if it looks OK or you may have to do all of this again. the very first line has to declare root's account. It should look like this:

root:[the encrypted password for root]:0:3::/:/bin/ksh [or whatever shell you want root to use]

there can't be a blank line or a blank character before this line for root.
 
Just in case, arufa, I don't want to insult your intelligence, but your title did say "no experience": to view the password file, type vi /etc/passwd. If the system can't find the vi command, type /usr/bin/vi. (a safer command is: /usr/bin/vipw. don't specify the file, it automatically brings up /etc/passwd. if you mangle the root account definition, the file won't save the bad changes and will tell you it can't save your changes.

And to change the password for root type: passwd and return when you are logged in as root.

And: after what you have been through the last couple of days, you have some experience now!

good luck.
 
Thank you, I was actually trying to find out how to do what you were saying. Im way new to UNIX, that is why I got the box, so I can learn how to work with the OS, and make use of an extra box. Thanks for your help, I appreciate it.

- Nathan
 
Hi Zarufa & jxfish2

Thanks jxfish2 .I completely forgot the two semi-colons and thanks again for correcting it.
At least for now Zarufa can enter into user mode .

So Zarufa , you should be able to get to the VUE or CDE (ie Graphic Interface ). If you do not have the Graphical Interface , then type init 4 after the hash(#) prompt

As shown below :

# init 4

Rgds , omari
 
Zarufa-Nathan, you are welcome. Good luck with learning Unix.

Browse this forum as often as you can to learn about HP-UX. There are a lot of smart people in this forum who are eager to help and share their solutions to problems.

Check out the General Unix Forum and the Scripting forum, too. Topics there might not seem relevant at the beginning, but you will need some of the skills discussed in those forums, too.

Have fun learning! And keep posting your questions.



 
Things are going good in Root, except with the passwd thing. WHen I type passwd at the prompt, it just asks me for a login name...when I vi /etc/passwd it comes up with a ton of ~ going down the screen. Ive went though the man on it and Im not sure what to do with it completely how do I edit it and get it so when I do type "init 4" I can actually log on. O ya, when I type Init 4, it doesnt startup the gui, just goes to a login screen at a prompt type thing.
Thanks for all your help.

Nathan
 
Do an ls -l /etc/passwd. How many bytes is the passwd file? It sounds as if your passwd file is empty.
 
Bi-

When I did a ls -l /etc/passwd
I got
-rw-r--r-- 1 0 Other (date stuff)

If the passwd is empty, how do I make it...ummmm...unempty.
 
To make it unempty, you have to be able to open it. I think you can do this because you said all you saw were a bunch of ~ running down the page when you did.

I'm beginning to wonder if you have an /etc/group file that has anything in it. Do you? Here is what your /etc/group file should look like:

root::0:root
other::1:root,hpdb
bin::2:root,bin
sys::3:root,uucp
adm::4:root,adm
daemon::4:root,daemon
mail::6:root
lp::7:root,lp
ttyp::10:
nuucp::11:nuucp
users::20:root
nogroup:*:-2:

(There were default groups that were put in my system when I installed.)

Now, for the /etc/passwd file:

open /etc/passwd (vipw /etc/passwd). I will assume it is totally empty. Here are the steps for getting root in there:

In the open empty file do this:
type i (to get into insert mode)
type root:*:0:3::/:/bin/ksh
press Esc
type :wq! and press return

Remember: you cannot have an empty line or an empty character before the word root. vipw should prevent you from doing that.

At the command prompt type passwd and press return.
you should be prompted to type in a password for root. then you will be asked to type it again.

try to bring the system to init3 or init4. If you can't, it may be because you don't have the other accounts that things in the OS require.

Here are the default accounts that are created in the /etc/passwd file (besides root). the * in these account defnitions is not a mistake:

daemon:*:1:5::/:sbin/sh
bin:*:2:2::/usr/bin:/sbin/sh
sys:*:3:3::/:
adm:*:4:4::/var/adm:/sbin/sh
uucp:*:5:3::/var/spool/uucppublic:/usr/lbin/uucp/uucico
lp:*:9:7::/var/spool/lp:/sbin/sh
nuucp:*:11:11::/var/spool/uucppublic:/usr/lbin/uucp/uucico
hpdb:*:27:1:ALLBASE:/:sbin/sh

Since you don't have these very important files, I'm wondering what else you might not have and if it would be better if you did a complete reinstall. (But did you say you have the OS on a CD but no CD ROM on the system?



 
It worked, sorry it took so long to let you know. Once I went and change the passwd file everything was good. I had put the system on a KVM, and the keyboard I was using wasnt letting me do the commands right. But I changed it and, now Everything boots up great. Thanks for all the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top