Link to home
Start Free TrialLog in
Avatar of raza
razaFlag for United States of America

asked on

yppassword change ?

I m runing unix on solarius. I m trying to change user passowrd but its seem giving me hard time. I login in as root and type yppasswd user1 it give me Enter Login(NIS) password. and when I type new password it say Sorry : wrong passwd Permission denied.
I m login as root.

I tried to change root pass word by typeing yppasswd it give me this error
yppasswd: changing password for root
yppasswd: root does not exist

??
whats wrong?
Avatar of tfewster
tfewster
Flag of United Kingdom of Great Britain and Northern Ireland image

yppasswd prompts you for the old password first, then the new one (twice)

Even as a root user, you can't use yppasswd to change a users NIS password without supplying the original password UNLESS you are logged in as root on the NIS master (For additional security - You may have root access on your local machine, but not on every system on the network).

The root password isn't in the NIS maps (for security & for when booting to single user mode) - It's a local user on each system, so just use passwd to change roots password.
Avatar of raza

ASKER

Yes, I know...that

I login as root which machine NIS runing it from.
so It would be a root for NIS?

to change user password how do I need to do? how do I logon as NIS master ?
Do "ypwhich -m passwd" to check which machine is the NIS master server; Log in to that server as root.

You can then do "yppasswd user1" without being prompted for the old password.

Avatar of raza

ASKER

it should work I m not sure whats wrong...
I logs on with same machine with root acount and I get the same error...
and even if I try tp change root password by yppasswd i get below error.

yppasswd: changing password for root
yppasswd: root does not exist

> I logs on with same machine with root acount and I get the same error...
Which machine? The NIS master server? What results did you get when you tried the suggestions in my last post?

> and even if I try tp change root password by yppasswd i get below error.
You can't change the root password with yppasswd (as I explained before).  



Avatar of sjgrit
sjgrit

Legend (just to be sure there's no confusion on terminology):
# <-- this is the prompt for super-user (root account) any shell, I prefer standard bourne for root
# some-command  <-- enter this command ( "some-command") then hit enter

1. as already suggested, try
# ypwhich -m
This will give you a list of all NIS maps AND the hostanme of the NIS master server.

2. Login the the NIS master server, telnet in is OK but I recommend you use the NIS master's console device.  Either login as a normal user and "su" to root, or just login as root.

3. Execute
# ypcat passwd
and look to make sure root is NOT in the NIS maps.  It should NOT if NIS was properly configured. IF there is an entry for root, then yppasswd SHOULD work.

4. I am assuming that root is NOT in the NIS passwd map.  Try executing
# cat /etc/passwd
You should see an entry for a user called root, column 1, user ID 0, column 3.

5. IF a) you are logged into the NIS master server as root (or you have used su to become root),
b) you did NOT see an entry for root in the NIS passwd map (step 3), and c) you did find a root account defined in the /etc/passwd file, you should be able to simply execute
# passwd root
New password: enter-new-password
Re-enter new password: enter-new-password

Note: If you logged in as root (you did not su to root), you do not have to enter
# passwd root
you will only have to enter:
# passwd
by itself.

yppasswd is used to change passwords for users defined in the NIS passwd maps. It will not change paswprds in the local /etc files (specifically /etc/shadow under Solaris).  Under current version s of Solaris (2.6, 7 and 8), the passwd command is "name service aware", meaning that if your login was authenticated using a local file (/etc/passwd and /etc/shadow), it will change the local files.  If you were authenicated by NIS, then passwd command will update the NIS passwd maps automatically.  Might be wise to caheck the /etc/nsswitch.conf.  Look for the line that starts "passwd:".  Following this entry on the same line is where a login will be authenticated, and the order in which it will be attempted.  When running NIS, this line is usually :
passwd:   files   nis
meaning that the local /etc/passwd and /etc/shadow will be checked first, then check with NIS if that user's account is not defined in the local files.

BTW - in order for sucessful password changes to occur in the NIS maps, the rpc.yppasswdd daemon must be running on the NIS master server.

Additional Notes:  Since there should NOT be a root account in the NIS maps, to change the root password on ANY host (even if it is as NIS client) just use the passwd command by itself.

See also:  check man pages on passwd, yppasswd, and nsswitch.conf (nsswitch.conf format can be found in section 4 of man pages, enter "man -s 4 nsswitch.conf" if necessary).
Avatar of raza

ASKER



>3. Execute
># ypcat passwd
>and look to make sure root is NOT in >the NIS maps.  It should NOT if NIS >was properly configured. IF there is >an entry for root, then yppasswd >SHOULD work.


I can see a root entry when I run ypcat passwd.
what sould I do now?




OK - What operating system is NIS server and client(s) running?
sjgrit
Avatar of raza

ASKER

SunOS 5.6
ASKER CERTIFIED SOLUTION
Avatar of exler
exler

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of raza

ASKER

Answer accepted