• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 259
  • Last Modified:

NIS - possible to extend group membership locally

Hello experts,
let's pretend there is a Solaris-box (5.7) which gets logon-information via NIS from a server where I don't have root-access.
Is it possible to extend group membership locally - where I have root-access?
E.g. asking NIS, "user1" is in "group1".
I want him to be in "group1" AND -locally- in "group2" .
Trying "usermod -G group1,group2 user1" brings "user1 does not exist".
If I try to "useradd user1" on the local machine it says "already in use".

I hope you get my point and have an idea how to solve this.

Many thanks in advance, krisse.
0
krisse13
Asked:
krisse13
  • 2
1 Solution
 
wesly_chenCommented:
Hi,

  You can edit /etc/group and add "group2" in it like
--/etc/group
group2:x:<GID>:user1    <=== GID need to match group2's GID in NIS (do "ypcat group | grep group2")
---
And check the /etc/nsswitch.conf for the following line:
group:  files nis

Then "su - user1" as root and "groups" to check the if user1 in group2.

Regards,

Wesly
0
 
krisse13Author Commented:
...which is exactly what I needed. Works fine.
I thought that if usermod can't do that, there would be no effect in editing /etc/group by hand. I was wrong.
Thank You, Wesly.
0
 
wesly_chenCommented:
Actually, you can edit /etc/nsswitch.conf
-----
passwd: files nis  <=== take out nis
group: files nis  <== take nis
----
And use "usermod".
Then put "nis" back.

Wesly
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now