I am trying to create a simple password script but it seems not working well.
What I'm trying to do is to sync the yppasswd and smbpasswd. So I created this:
#!/bin/csh
echo ""
echo "Please enter old password: "
set OLDPASSWD = $<
echo "Please enter new password: "
set NEWPASSWD = $<
yppasswd << EOF
$OLDPASSWD
$NEWPASSWD
EOF
smbpasswd << EOF
$OLDPASSWD
$NEWPASSWD
EOF
But not luck enaf to make it works. Any expert can give me a clue?
this wont work the way your doing it but here are a few suggestions
1) use sh/ksh/bash for scripting (not really relevant but good practice)
2) If possible don't use NIS - use LDAP and store your passwords in one place then there will be no need for this script.
3) configure SAMBA to authenticate against NIS with a PAM module. again - one password store.
4) just have the user run each command. it should not be that big of a deal as they don't change passwords that often.