Operating System - HP-UX
1821642 Members
2852 Online
109633 Solutions
New Discussion юеВ

single user mode - changing root passwd

 
SOLVED
Go to solution
shashi kanth
Super Advisor

single user mode - changing root passwd

I am seeing a strange behaviour with HP-Ux 11.23 PA.

I played with SSH, RSH, Rlogin, inetd, and bash shell . Suddenly, i am not able to login to the box as a root user (physically, and remotely). I am not understanding what went wrong.

I have copied the /etc/nsswitch.hpdefault to /etc/nsswitch.conf and modified /etc/nsswitch.conf with "files" as staring options for "hosts" and "networks". Does this actions caused this problem ?

Can anyone tell me, how to go single user mode in HP-Ux so that i can change the root passwd?


25 REPLIES 25
Luk Vandenbussche
Honored Contributor

Re: single user mode - changing root passwd

Interupt the boot process.
at the IPL> prompt type 'hpux -is'

Steven E. Protter
Exalted Contributor

Re: single user mode - changing root passwd

Shalom,

You can't change the default shell in root to bash in /etc/passwd. Well actually you can but your system will stop working, so don't do that.

All hpux machines have a 10 second prompt that permits you to interupt boot at console.

bo

# Answer Y to interact question.
hpux -is


Just as a pointer, -lm will take you into logical volume maintenance mode which is useful for lvm problems in the future.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ganesan R
Honored Contributor

Re: single user mode - changing root passwd

Hi,

1.Reboot the system.
2.Interrupt the autoboot process when it asks to do so.
3.In main menu give "bo pri"
4.Press "Y" to interact with IPL
5.In ISL prompt give "hpux -is" to boot the system into single user mode
6.System will boot into single user mode.
7.Then you can use passwd command to change the password
8.The steps may not work for Trusted systems.
Best wishes,

Ganesh.
Joelmel Roche
Valued Contributor

Re: single user mode - changing root passwd

Boot in Primary disk
Please select a boot option

HP-UX Primary Boot: 0/1/1/1.2.0
EFI Shell [Built-in]
Boot option maintenance menu
Security/Password Menu

Press Any Key to interrupt Autoboot
AUTO ==> boot :IINSTALL
Seconds left till autoboot - 9
>> Interrupt the auto-boot sequence by pressing the SPACE bar.


HP-UX Single user mode:

HPUX> boot vmunix -is

whiteknight
Honored Contributor

Re: single user mode - changing root passwd


Shashi,

I encourage you to learn from our knowledge based, system boot handbook.

http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en&docId=emr_na-c01037092-1



hope this help

WK
Problem never ends, you must know how to fix it
shashi kanth
Super Advisor

Re: single user mode - changing root passwd

All,

I have gone to the single user mode, changed the password for root, and changed the shell of root from "/usr/local/bin/bash" to "/sbin/sh", rebooted the box, but still root not able to login.

Once again went to single user mode, added a normal user, rebooted the box, but still even a normal user also not able to login.

What is this behaviour in HP-Ux ?

I am not understanding, which one is the cause for this problem .

Ganesan R
Honored Contributor

Re: single user mode - changing root passwd

Hi,

Could you paste the error you are getting when you login?

Thanks
Best wishes,

Ganesh.
shashi kanth
Super Advisor

Re: single user mode - changing root passwd

Login incorrect
Ganesan R
Honored Contributor

Re: single user mode - changing root passwd

Hi,

Are you able to change the password in single user mode?

Are you able login through console?

If /etc/securetty is present, check the content or move the file and try to login.

Thanks.
Best wishes,

Ganesh.
whiteknight
Honored Contributor

Re: single user mode - changing root passwd


Shashi,

1) Are you in trusted system mode ?

if you can go to single user mode.

2) /usr/lbin/tsconvert -r

3) change root password

4) init 3 (to multi user mode)

5) login again.

WK


Problem never ends, you must know how to fix it
shashi kanth
Super Advisor

Re: single user mode - changing root passwd

I am able to change the password at single user mode.



/etc/securetty file is present, and this file conatils an entry "console"

I have deleted that entry, then i executed "login" command , and given my root credentials, but still it fails.

shashi kanth
Super Advisor

Re: single user mode - changing root passwd

Even i moved /etc/securetty file, but still ............


I am running the system in trusted mode.



shashi kanth
Super Advisor

Re: single user mode - changing root passwd

Sorry, sorry, i am not running the system in trusted mode.


In HP-Ux , which log file contains the all login attemts ?

Anshumali
Esteemed Contributor

Re: single user mode - changing root passwd

wtmp
Dreams are not which you see while sleeping, Dreams are which doesnt allow you to sleep while you are chasing for them!!
Joelmel Roche
Valued Contributor

Re: single user mode - changing root passwd

If the root password is incorrect for some reason and noone is currently
logged in as root, boot the system into single user mode, fsck the file
systems if necessary and reset the root password:

# mount -a
# /usr/sam/lbin/usermod.sam -F -p "" root

Note: The system should be kept in a secure place and only users with
appropriate privileges should have access to the system to boot it
into single user mode.

Initialize the system into multi user mode, login as root and choose a correct
root password. Remain logged in as root and verify that the new password works.

Note: If boot authentication has been configured, the root password also
needs to be supplied to login to single user mode. The above solution
will not work in this case.

Joelmel Roche
Valued Contributor

Re: single user mode - changing root passwd

Try this...
# /usr/lbin/modprpw -m
usrpick=NO,syspnpw=NO,rstrpw=NO,nullpw=NO,syschpw=NO,sysltpw=NO [username]
#

For example:

# /usr/lbin/modprpw -m
usrpick=NO,syspnpw=NO,rstrpw=NO,nullpw=NO,syschpw=NO,sysltpw=NO cmcd
#

Logged in as cmcd:

$ passwd
Changing password for cmcd
Old password:
Last successful password change for cmcd888: Wed Sep 15 16:18:05 2004
Last unsuccessful password change for cmcd888: NEVER

passwd: not allowed to run passwd
Ganesan R
Honored Contributor

Re: single user mode - changing root passwd


Hi Shashi,

Try move the file /etc/securetty instead of remove the "console" entry.

#mv /etc/securetty /etc/securetty.old

I am not sure how you are login into the system. If that file contain the entry "console", then you will be able to login as root through serial console only.

Thanks.
Best wishes,

Ganesh.
shashi kanth
Super Advisor

Re: single user mode - changing root passwd

"/usr/sam/lbin/usermod.sam -F -p "" root" -- doesn't help.



/usr/lbin/modprpw -- doesn't help.


I think, above two are for trusted systems.

i have moved the /etc/securetty file to /etc/securetty.bak

But, still, no user (root, as well as my normal users) not able to login (physically - console, as well as remotely).



Robert-Jan Goossens
Honored Contributor

Re: single user mode - changing root passwd

Hi,

--
I played with SSH, RSH, Rlogin, inetd, and bash shell
--

Did you change the /etc/inetd.conf file, could you remove the changes or cp a backup file back?

If /usr is mounted could you run pwck?

Regards,
Robert-Jan
Ganesan R
Honored Contributor

Re: single user mode - changing root passwd

Hi,

It seems something strange with /etc/pam.conf

Check the file permission and ownership of this file. ownership shoud be root:sys and permission should be 444

If it doesn't work try move this file to some other name. Then copy the templete from /usr/newconfig/etc/pam.conf

#mv /etc/pam.conf /etc/pam.conf.old

#cp /usr/newconfig/etc/pam.conf /etc/pam.conf

Again check the permission and ownership and try login

Thanks
Best wishes,

Ganesh.
Steven E. Protter
Exalted Contributor
Solution

Re: single user mode - changing root passwd

Shalom,

pwck
grpck

There seems to be an inconsistency in the /etc/passwd or group files.

Or the changes to nsswitch.conf are causing problems.

You need to review all changes that were done to implement the bash shell and think about backing them out.

Try the passwd command in single user mode.

If it fails see what is written to the syslog file. mount /var and /usr before trying the command.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
shashi kanth
Super Advisor

Re: single user mode - changing root passwd

Ok , the problem is solved, the problem was /etc/nsswitch.conf

But, i am not understanding, how nsswitch effects the login problem?

My nsswitch.conf looks like bellow, this file is copied from /etc/nswitch.hp_defaults, and i have done few modifications.


passwd: compat
group: compat
hosts: files dns [NOTFOUND=return] nis [NOTFOUND=return]
ipnodes: dns [NOTFOUND=return] files
networks: files nis [NOTFOUND=return]
protocols: nis [NOTFOUND=return] files
rpc: nis [NOTFOUND=return] files
publickey: nis [NOTFOUND=return] files
netgroup: nis [NOTFOUND=return] files
automount: files nis
aliases: files nis
services: nis [NOTFOUND=return] files



I have removed "files" word at end, and added in the begining of "hosts" and "networks" options.

How this line caused this problem ?

Steven E. Protter
Exalted Contributor

Re: single user mode - changing root passwd

Shalom,

/etc/nsswitch.conf can tell your system how to authenticate users.

With the wrong options, you could have asked root to authenticate against a windows ads primary domain controller. root isn't going to like that very much.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
shashi kanth
Super Advisor

Re: single user mode - changing root passwd

I believe /etc/nsswitch.conf is not for authentication, this file is for to tell the system the order for to lookup IP/Hostname.