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!

A script to change root passwords 1

Status
Not open for further replies.

btriggs127

Technical User
Dec 1, 2000
16
US
I work in an HP and IRIX environment and need to change the root passwords on the workstations. Can this be done with an AWK Script? For security reasons we do not use a .rhost file or a host.equiv file. But is it still possible?
 
There are about 70 systems that need to be changed and they would all need to be done individually. I was just looking for a way to save some time and increase my own knowledge.
 
What I have done works but not what I was hoping for, it is as follows:

#!/bin/sh
set -- $(cat /FILE_THAT_CONTAINS_HOSTNAME)
while [ "$1" != "" ]
do
rlogin $1
shift
done

The problem is that I would prefer to do somthing along the lines of RSH or on the HPs REMSH, but that utility will not support the returns from the commands since they are waiting for input. I was curious if there is a way in AWK or something else that will supply the information for the return of either RLOGIN or RSH. In summary a script command or Unix Utility that will connect to different host in a logfile as root and change the password to a presupplied password. If this is not possible and I have already set up the easiest way to do this, although slow and cumbersom, that is fine I just like to automate as much as possible.

Thanks for any additional input
-Brian
 
That script is excatly what I wanted. Thanks.
-Brian
 
I am working with UNIX system, so if i forgot the root password how i can change it while i still don't know the last password? thanks lot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top