Operating System - HP-UX
1751878 Members
5437 Online
108782 Solutions
New Discussion юеВ

Re: Changing GID for two users in NIS

 
SOLVED
Go to solution
Vishu
Trusted Contributor

Re: Changing GID for two users in NIS

Hi Ganesan,

Here are the contents of /var/yp/Makefile


DIR =/etc
DOM = `domainname`
NOPUSH = ""
ALIASES = /etc/mail/aliases
YPDIR=/usr/sbin
YPDBDIR=/var/yp
YPPUSH=$(YPDIR)/yppush
MAKEDBM=$(YPDIR)/makedbm
REVNETGROUP=$(YPDIR)/revnetgroup
STDETHERS=$(YPDIR)/stdethers
STDHOSTS=$(YPDIR)/stdhosts
MKNETID=$(YPDIR)/mknetid
MKALIAS=$(YPDIR)/mkalias
PWFILE=$(DIR)/passwd

Ganesan R
Honored Contributor

Re: Changing GID for two users in NIS

Hi,

It means /etc/passwd file was used to create the NIS maps initially and removed ALL NIS user entries from the local password which most admin will do. This is to avoid the NIS users to login locally on NIS Master.

Best wishes,

Ganesh.
Vishu
Trusted Contributor

Re: Changing GID for two users in NIS

Thanks Ganesan,

but now the thing is how would i do this i.e. change my GID from 500 to 501. anyone has any idea?
Steven Schweda
Honored Contributor

Re: Changing GID for two users in NIS

> but now the thing is how would i do this
> i.e. change my GID from 500 to 501.

Edit /etc/group (or whatever /var/yp/Makefile
saya that it used for "group")?

> Jul 29, 2009 14:24:40 GMT
> [...]
> You also have to change /etc/group !

I don't understand what's not clear to you.
What, exactly, do you wish to change? How do
you see what it is now? As usual, showing
actual commands with their actual output can
be more helpful than vague descriptions and
interpretations.
Ganesan R
Honored Contributor

Re: Changing GID for two users in NIS

Hi Ranju,

You should be having the backup of master passwd file used to generate the NIS maps earlier somewhere on the NIS master server. If the group is already exist you have to modify only the passwd file and change the PWFILE entry in Makefile to point the source passwd file and run ypmake.

Though I haven't tried, you can also try via SAM to change the attributes for NIS users.
Best wishes,

Ganesh.
Vishu
Trusted Contributor

Re: Changing GID for two users in NIS

Ganesan, Thanks for your findings...but i have checked that i no longer have that file in the server. the NIS database was created around 2-3 years ago. i was not managing this server that time. Well, dont know also that SAM will work in it, bcoz have not tried it before.

@Steven,
Please read my earlier post, i want to change the GID for two users only i.e. to edit the password file, not the /etc/group file. Please go through the posts and suggest if anything u have in it.
Steven Schweda
Honored Contributor

Re: Changing GID for two users in NIS

> [...] i want to change the GID for two
> users only i.e. to edit the password file
> [...]

So why not "edit the password file", and make
the changes you want? Or use usermod to make
the changes, if you prefer.

> i think usermod will only work on
> /etc/passwd but not on passwd.byname.

Well, yes, but /etc/passwd on the NIS master
server is where NIS gets the data for
passwd.byname. You change etc/passwd on the
NIS master server, then ypmake (or
equivalent) rebuilds the NIS passwd data base
from that file. (And it should do a yppush
to propagate the new data to the consumers,
too, as I recall.)
Steven Schweda
Honored Contributor

Re: Changing GID for two users in NIS

> [...] /etc/passwd on the NIS master
> server is where NIS gets the data for
> passwd.byname.

That is, /etc/passwd on the NIS master server
is where NIS gets the data for passwd.byname
_unless_ someone has changed /var/yp/Makefile
so that it gets the passwd data from some
other file.
Vishu
Trusted Contributor

Re: Changing GID for two users in NIS

@ Steven Schweda ,

I agree to it that NIS passwd.byname get its data from /etc/passwd while doing ypmake, but i have already post that my /etc/passwd does not have those users in it. Those users are deleted from /etc/passwd after doing ypmake and only exists as NIS users, not as local users. Ganesan has also told this thing in the post just prior to your previous post.

So, if i try to run usermod, it came up with "user does not exist". Please suggest now.
Steven Schweda
Honored Contributor

Re: Changing GID for two users in NIS

> [...] Those users are deleted from
> /etc/passwd after doing ypmake and only
> exists as NIS users, not as local users.
> [...]

In that case, I'd probably try to add them
back into the NIS master server's passwd
source file (normally /etc/passwd).

Do you _want_ to have users in the NIS data
but not in the NIS master server's
/etc/passwd file? If so, then it would seem
to me that /var/yp/Makefile should be
using some file other than the NIS master
server's /etc/passwd file as its passwd data
source.

> [...] here is the user difference between
> local and NIS users.
>
> root # cat /etc/passwd | wc -l
> 79
> root # ypcat passwd | wc -l
> 5352

Was that done on the NIS master server?

I'm still confused, but there may be some
hope.