1838681 Members
4507 Online
110128 Solutions
New Discussion

changing root password

 
SOLVED
Go to solution
terry123
Regular Advisor

changing root password

hi All,

may i know are there any way to keep check on when the root password has been changed?

after i changed the root password i can't find any related info under /var/adm/syslog.

thx so much.

terrytse
8 REPLIES 8
Patrick Wallek
Honored Contributor

Re: changing root password

If your system is trusted, you can do a:

# /usr/lbin/getprpw -m spwchg root

If your system is not trusted you can try:

# passwd -s root

#man getprpw

#man passwd

for more information on each command.
terry123
Regular Advisor

Re: changing root password

thx, but passwd -s root will only show the password attributes for the root user.

may i know are there any log file which will keep check on root password changed?

Ganesan R
Honored Contributor

Re: changing root password

Hi,

root history file will have the details if the password has been changed by command.
Best wishes,

Ganesh.
Jannik
Honored Contributor

Re: changing root password

There is no HPUX way to do this, as i see it you have to options witch are not perfect.

Option 1:
Write a wrapper for the password program. And change the order of /etc/PATH to run you passwd script before the original. The down site is that users can run the passwd program directly with full qualified path or the /etc/PATH can be changed.

#!/usr/bin/ksh

USER=$1

logger -t PASSWORDCHANGE -p local0.info "The password for $USER is changing"

/usr/bin/passwd $USER

if [ $? -ne 0 ]
then
logger -t PASSWORDCHANGE -p local0.info "Failed to change password for $USER"
else
logger -t PASSWORDCHANGE -p local0.info "password changed for user $USER"
fi

Option 2:
Move the original passwd binary to a new location and place the wrapper instead. This is not a good sollution because "sam" will try to use the replaced file.
The other downside is that and OS opgrade will replace your file.

You might combine option 1 with some RBAC to make sure how will be able to run the original passwd command.

Best regards JT
jaton
terry123
Regular Advisor

Re: changing root password

thx All,

but may i know where can i find the root history file?

Johnson Punniyalingam
Honored Contributor
Solution

Re: changing root password

Hi Terrytse,

Please look for the history under the /root

example:-

cd ~root
ls -la
look for this file --> sh_history

more sh_history,

hope this helps

Thanks,
Johnson


Problems are common to all, but attitude makes the difference
Dennis Handly
Acclaimed Contributor

Re: changing root password

>but may i know where can i find the root history file?

It's named by $HISTFILE. Typically sh doesn't define this for root. One default would be ~/.sh_history.
terry123
Regular Advisor

Re: changing root password

thx all for the help.

;)