Operating System - HP-UX
1819774 Members
3354 Online
109606 Solutions
New Discussion юеВ

HP-UX 10.20 single user question

 

HP-UX 10.20 single user question

Hey guys, I've got a quick question, lemme give some of my background:
A few days ago I got my first Pa-RISC machine, an HP9000 C110.. I found that it was running 10.20 so I began to tinker around a bit, I've never used HP-UX before so it's all new to me.. well I quickly discovered sam, and then swinstall.. so I installed some software.. to make it a bit more like home, first I installed bash.. which me being a BSD/Linux user at heart, was much easier for me to get comfortable in..
Well, I then was using sam and adding users and removing the old system users, as well as changing what shells users had.. I changed the root shell to bash.
Down the road, I realized that I had installed this software to the wrong location (my / parition was almost full, so I was going to move things over to my /users) so I began to uninstall the software I had on there (ie bash again).. well not thinking clearly, I didn't reassign root's shell before I uninstalled bash, so now root has no shell and I obviously have no way of fixing this (I can't reinstall bash I'm not root)

So here's my problem: I need to figure out some way to boot this machine into single user mode so that I can change root's shell path in the /etc/passwd. Does anyone know how to do this on 10.20?
I can't use the media, it didn't come with the machine, I'm running this headless and just using a null modem cable to connect to it if I need to work in the boot prom (I already configued it to the network at my house, I can telnet in to it, if there is a fix for this without going into the prom).. can someone please help me out?
13 REPLIES 13
PIYUSH D. PATEL
Honored Contributor

Re: HP-UX 10.20 single user question

Hi,

Boot the server and when it prompts for pressing any key....at startup. Press the key.

Then you will get the ISL prompt

ISL>sea

Find out the boot disk and its path

ISL> bo P1

do you want to interact with IPL, say yes

ISL> hpux -is

This command will let you go to the single user mode.

Hope this helps.

If you have a Recovery tape ( created by somebody) then you can use that.

Or else use the CORE MEDIA CD which comes along with the server. It gives you an option for recovering your system.

Piyush
PIYUSH D. PATEL
Honored Contributor

Re: HP-UX 10.20 single user question

Hi,

If you machine is ON then use

#init s or init S

The machine will go to single user mode.

Piyush
MANOJ SRIVASTAVA
Honored Contributor

Re: HP-UX 10.20 single user question

Hi Thomas

1. Switch on the machine at the console , before it goes to auto boot , it will give you an option to press any key wiht in 10 seconds , press a key.

2. This will take you to the IPL mode , here you can do a BO PRI , or boot from the preimary path ( I assume that the system was working fine before)It will ask you wheterh to interact with ISL say yes , this takes you to the ISL prompt.

3. here enter hpux -is , this will take you to the single user mode , now you can edit /etc/passwd to change the default shell .

4. If vi doesnt work then you will have to mount the vg00 partitions , just do mount -a and you are good to go.


Manoj Srivastava
Patrick Wallek
Honored Contributor

Re: HP-UX 10.20 single user question

The others have given good advice on how to get the machine to single-user mode.

Now my advice: NEVER NEVER NEVER NEVER change root's shell. It should ALWAYS be /sbin/sh. If it is not set that way, it can cause problems when you reboot your machine.

If you want to use something else, log in as root and then execute whatever shell you want to use.
Wodisch
Honored Contributor

Re: HP-UX 10.20 single user question

Hi,

most certainly you will have to boot from the "core/install" CD-ROM to recovery from your failure.
Instead of installing you can use this CD-ROM in a menu-driven way to repair your boot-disk.
And never, ever change root's shell to something other than "/sbin/sh" - for a lot of reasons (*search* the forums for "+root +bash").

As soon as it is back in operation get "Ignite/UX" (free from the Application CD-ROMs, or from http:/software.hp.com/products/IUX ), install it and create a "make_tape_recovery" tape!
Then *next* time (there will be one ;-) you could simply boot from that tape and wait for about an hour - then you're back in operation.

Regards,
Wodisc
Pete Randall
Outstanding Contributor

Re: HP-UX 10.20 single user question

Piyush, Manoj, (& Thomas),

Since root's shell has been changed to a non-existent one (i.e. bash), will root be able to log in at all - even in single user mode? I'd test it but I'm not willing to sacrifice one of my systems.

Just curious,
Pete

Pete
PIYUSH D. PATEL
Honored Contributor

Re: HP-UX 10.20 single user question

Hi Pete,

I was also not very sure and thats why I wrote : Hope it helps

then I gave an option of trying with the CORE MEDIA Recovery CD.

Piyush
Pete Randall
Outstanding Contributor

Re: HP-UX 10.20 single user question

Piyush, Manoj, (& Thomas)

I dug up an old 715 workstation and will test on that - I'll let you know.

Pete

Pete
Pete Randall
Outstanding Contributor

Re: HP-UX 10.20 single user question

Hmmmmm, I'm not sure why it works, but it does. I changed root's shell in /etc/passwd to be /opt/bash/bin/bash (which doesn't even exist), rebooted into single user mode, it came up with root logged in and I was able to do my mount -a and vi /etc/passwd to switch the shell back.

Fascinating ;^)
Pete

Pete

Re: HP-UX 10.20 single user question

Wodisc,
I have no media what so ever, I got the machine from a garage sale so telling me to start from the core cd isn't going to apply to this situation, I also have no tape drive with this machine to make any form of backup/recovery.


Do you have suggestions on booting the machine and working around this problem in another way?
Sandip Ghosh
Honored Contributor

Re: HP-UX 10.20 single user question

You just boot in single user mode. Then do a vgchange -a y /dev/vg00 and mount -a.
Then do a vi on /etc/passwd file. This should solve your problem.

Pete:

It is working because in the single user mode it doesn't access the /etc/passwd file. Since it is not accessing the passwd file, it is not getting the shell (bash) what you have set in the passwd file.

Sandip
Good Luck!!!
Mark Vollmers
Esteemed Contributor

Re: HP-UX 10.20 single user question

Thomas-

you can't telnet into it, cause that isn't started in single user mode. when you boot it, can you see anything on the monitor? on my 715, there is a screen way at the beginning, right when the monitor warms up, that says press escape to halt boot. that should be the point when you can get in.

Mark
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"

Re: HP-UX 10.20 single user question

Hey guys, thanks a million for the help.. I'm a very new comer to HP-UX and learning the ins and the outs as we speak.. but I just tried those methods (after a few hrs of searching out a null modem cable ;)) and I'm glad to say that it was a quick fix, the machine booted right up into single user mode (just like the directions you guys offered said it would) and I didn't even need a mount -a but I'm back up and running so thanks for the help!