[comp.sys.next] changing su password in netinfo

mdixon@thelonius.PARC.xerox.com (Mike Dixon) (08/28/89)

somehow we've lost the su password to one of our machines.  if it were
a vanilla unix box i'd just boot it single user and hack the
/etc/passwd file, but with netinfo running that's not enough.  i can't
seem to niload the new passwd file without netinfo running, but of
course if i run netinfo i can't log in su & hence can't do the niload.

the only fix i can think of is to boot single user and smash the netinfo
database (/etc/netinfo/local.nidb/collection, as far as i can tell) with
a copy from the original system disk.  is there really no better way to
do this?
                                             .mike.

p.s.  they're on a net, but each has just a local netinfo database
--
Mike Dixon                  Xerox PARC              mdixon@arisia.xerox.com

dz@pumpkin.ucsb.edu (Daniel James Zerkle) (08/28/89)

In article <MDIXON.89Aug27185619@thelonius.PARC.xerox.com> mdixon@thelonius.PARC.xerox.com (Mike Dixon) writes:
>somehow we've lost the su password to one of our machines.

Write it down, next time.  Make someone take it home in a sealed
envelope....

>if it were
>a vanilla unix box i'd just boot it single user and hack the
>/etc/passwd file, but with netinfo running that's not enough.

0.9 is still pretty weak for the way passwords are implemented.
'Tis a bit irritating that the passwd file does nothing.

>i can't
>seem to niload the new passwd file without netinfo running, but of
>course if i run netinfo i can't log in su & hence can't do the niload.
>the only fix i can think of is to boot single user

You can boot off of an optical disk, then netinfo will be running...

>and and smash the netinfo
>database (/etc/netinfo/local.nidb/collection, as far as i can tell) with
>a copy from the original system disk.  is there really no better way to
>do this?

1. Nidump everything on the machine you want to preserve.  Especially
   the passwords.  Put the results in some convenient files.

2. Modify the passwords how you want them.  Probably just blank out
   the passwd for root.

3. Get some disposable optical disk with the whole operating system
   on it.  Boot from it and su to root.

4. Niload those conveniently saved files (including the modified passwd
   file) onto the floppy.

5. I forget for the moment what file the Netinfo is stored on (but
   "collection" doesn't sound familiar).  In any case, copy the file(s)
   from the optical disk to the place on the normal boot disk.  Should
   be ok, now.

>p.s.  they're on a net, but each has just a local netinfo database

Couldn't tell if they boot from the net or not.  Hope not, as this
could be completely wrong....

Good luck.  You may need it.

| Dan Zerkle home:(805) 968-4683 morning:961-2434 afternoon:687-0110  |
| dz@cornu.ucsb.edu dz%cornu@ucsbuxa.bitnet ...ucbvax!hub!cornu!dz    |
| Snailmail: 6681 Berkshire Terrace #5, Isla Vista, CA  93117         |
| Disclaimer: If it's wrong or stupid, pretend I didn't do it.        |

gerrit@mentor.cc.purdue.edu (Gerrit Huizenga) (08/28/89)

In article <MDIXON.89Aug27185619@thelonius.PARC.xerox.com>, mdixon@thelonius.PARC.xerox.com (Mike Dixon) writes:
> somehow we've lost the su password to one of our machines.  if it were
> a vanilla unix box i'd just boot it single user and hack the
> /etc/passwd file, but with netinfo running that's not enough.  i can't
> seem to niload the new passwd file without netinfo running, but of
> course if i run netinfo i can't log in su & hence can't do the niload.

Simple solution:  boot single user (bsd -s), start up /usr/etc/portmap and
then /usr/etc/nibindd.  Give it a second to init the netinfod's, and then
you can use niload to enter a new root passwd into the local database
(prepare a file with the single /etc/passwd line you want to use and then
"niload passwd . < your_new_file".

gerrit

eht@f.word.cs.cmu.edu (Eric Thayer) (08/28/89)

In article <MDIXON.89Aug27185619@thelonius.PARC.xerox.com> mdixon@thelonius.PARC.xerox.com (Mike Dixon) writes:
>the only fix i can think of is to boot single user and smash the netinfo
>database (/etc/netinfo/local.nidb/collection, as far as i can tell) with
>a copy from the original system disk.  is there really no better way to
>do this?

Another way in addition to Daniel Zerkle's suggestions is to move
/usr/etc/nibindd to /usr/etc/nibindd.off and reboot the system.  This will in
effect, start the system without NetInfo.  You can then log in as root, start
nibindd by hand and edit the netinfo stuff.


-- 
Eric H. Thayer      School of Computer Science, Carnegie Mellon
(412) 268-7679      5000 Forbes Ave, Pittsburgh, PA 15213

feldman@umd5.umd.edu (Mark Feldman) (08/29/89)

In article <MDIXON.89Aug27185619@thelonius.PARC.xerox.com>
mdixon@thelonius.PARC.xerox.com (Mike Dixon) writes:
>somehow we've lost the su password to one of our machines.  if it were
>a vanilla unix box...

Well, there are several solutions, some of which have already been mentioned.

A quick & dirty fix is to boot single user and add an niload or niutil to
set the root password at the bottom of the rc.local file.  Something like:

	niutil -createprop . /users/root passwd ''

will work quite well to remove the root password.

If any of the users on the NeXT are in the wheel group, none of this is
necessary because NeXT allows members of the wheel group to su root with
their own passwords.  Once root, the root password can be changed without
knowledge of the previous root password.

The local NetInfo database information is kept in the file
/etc/netinfo/local.nidb/collection.  Unfortunately, there are no shell-based
utilities for directly managing this file, which makes doing anything with
it yucky.

	Mark