NIS - possible to extend group membership locally

Posted on 2004-11-24
Last Modified: 2013-12-23
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.
Question by:krisse13
    LVL 38

    Accepted Solution


      You can edit /etc/group and add "group2" in it like
    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.



    Author Comment

    ...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.
    LVL 38

    Expert Comment

    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.


    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    What’s a web proxy server? A proxy server is a server that goes between clients and web servers, used in corporate to enforce corporate browsing policy and ensure security. Proxy servers are commonly used in three modes. A)    Forward proxy …
    This is an article about my experiences with remote access to my clients (so that I may serve them) and eventually to my home office system via Radmin Remote Control. I have been using remote access for over 10 years and have been improving my metho…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now