1825667 Members
4366 Online
109686 Solutions
New Discussion

No Shell for root user

 
Oliver Tian
Occasional Advisor

No Shell for root user

I accidentally modified the ?passwd? file through vi editor.
Now I receive ?No Shell? message when I login as root. Then it is disconnected with the host.
What Can I do to fix it? Please help. Thanks.
Oracle DBA
10 REPLIES 10
Bernie Vande Griend
Respected Contributor

Re: No Shell for root user

Assuming the root shell is the only problem,
you can try this:
su - root -c /bin/sh
Hopefully it will give you a root shell and you can then fix the password file.
Booting to single user mode also may work.
Ye who thinks he has a lot to say, probably shouldn't.
Sachin Patel
Honored Contributor

Re: No Shell for root user

Hi Oliver,
Bad move on friday.

interrupt the boot process within the 10 sec.
-Choose Y, to Interact with ISL
#BO PRI (or the correct path of your local primary hdd)
#hpux -is (launch hp-ux in single user mode)

#mount /usr and /var (mount the necessary file system)
#vipw (to change the shell in /etc/passwd)

Also check this thread
http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0xe66146ff9277d511abcd0090277a778c,00.html

Sachin
Is photography a hobby or another way to spend $
A. Clay Stephenson
Acclaimed Contributor

Re: No Shell for root user

Hi Oliver.

You are a bad, bad boy.

Unless Bernie's su suggestion works this is really bad.

Booting single-user doesn't help at all. You need to boot from a recovery CD so that your root is actually on another filesystem. You then mount your old system / and edit or copy /etc/passwd.

If you have a spare system, another option is to remove the drive and put in a bootable system and make the changes. In any event, a recovery CD is your easist option.

Clay
If it ain't broke, I can fix that.
Darrell Allen
Honored Contributor

Re: No Shell for root user

Hi Oliver,

Do you use Omniback or another backup product? If so, are there "Operator" accounts that you could use to restore /etc/password with? I'd save the current one first incase anyone else has changed a password since the backup was made.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Oliver Tian
Occasional Advisor

Re: No Shell for root user

su - root -c /usr/bin/ksh command does not work, and no backup had been done. I think the only option I have now is to use the Recovery CD to fix it.

Can you give me a list of the steps on how to recover it? Thanks.
Oracle DBA
Sachin Patel
Honored Contributor

Re: No Shell for root user

Hi Oliver,
Look the thread that I suggest it has lots of discussion about what to do when you are using recovery CD

Sachin
Is photography a hobby or another way to spend $
Sanjay_6
Honored Contributor

Re: No Shell for root user

Hi Oliver,

Can you try,

su root -c /sbin/sh

See if it helps.

thanks
Oliver Tian
Occasional Advisor

Re: No Shell for root user

There was no luck with "su root -c /sbin/sh".
I am using HP-UX B.11.11 on L-Class box. Can I
pull out the boot disk and plug in a working HP-UX B.11.20 Itanium box to make the change?

I do not have recovery CD for HP-UX B.11.11. Can I use HP-UX B.11.00 to boot up my system and then correct the problem?

Thanks.
Oracle DBA
Sachin Patel
Honored Contributor

Re: No Shell for root user

Hi Oliver,
I don't see any problem. You are just copying /etc/passwd file.

Sachin
Is photography a hobby or another way to spend $
eran maor
Honored Contributor

Re: No Shell for root user

Hi Oliver

you can boot from the recovery cd for 11.00 because you need to copy /etc/passwd from the recovery cd .

booting from the recovery cd is booting a system to the memory and your / is inside the memory , after you boot from this system you can mount your own / that is the disk and copy files from te system in the memory to the system in the disk .

after booting you will get a menu with 6 option , you will need to oper l - load a file

because the recovery cd boot into the memory it puts in this system only few command .

you will need to load some command but i cant tell you which command because i dont remember all of them .

i will also advise you not to do this if you dont know how to do it .

i can send you info about how to use recovery cd but the best way is to contact HP support for a help on this issue .

if you want the info please give your e-mail adress and i will send it to you .

second - allways do a ignite backup of the system , if you had ignite backup it would take a few min. to solve this issue .
love computers