Q: How can I change my password from a non-NEXTSTEP system, given that the NIS (formerly known as Yellow Pages or "YP") database is mastered by NetInfo?
A: Replace the standard yppasswd command on the non-NEXTSTEP system with a shell script that rsh's the NetInfo master server and passes the arguments on as arguments to passwd. Something like:
#
# replace the yppasswd command on your non-NeXT machine with this shell
# script. This shell script checks if it received a username as an
# argument, if not it will default to the user that executes the command.
# The script turns echo off, logs into the configuration server and runs
# the passwd command that updates the NetInfo database. It then restores
# the echo status to it's initial value.
#
#!/bin/csh
set Server = "ni_server"
set Account = ${1}
if (${Account} == "") then
set Account = `whoami`
endif
(stty > /dev/tty) |& grep '.-echo' >& /dev/null
if ( ${status} != 0 ) then
set NoEcho=0
else
set NoEcho=1
endif
stty -echo
rsh ${Server} /bin/passwd $Account
if ( ${NoEcho} == 0 ) then
stty echo
endif
Then, every 5 minutes (or 15, or 30...), have cron test for changes in the password file by nidumping and comparing. If they are different, automatically perform a ypmake for the password file. Alternately, have the rsh touch a file on the master server that causes cron to dump and push the database.
Replace ni_server in the above shell script with the name of your configuration server. The shell script assumes that the hosts are equivalent, see the man page for hosts.equiv(5) for more information. Be sure to make this shell script read-only and set its ownership to root.
QA556
Valid for 1.0, 2.0, 3.0, 3.1