Adding group to group file in Solaris 9 UNIX

Posted on 2007-10-08
Last Modified: 2013-12-27

I have a group called samsu. I want to add this group to the group file in dir /etc

I want to know following:-0
a. Do I need to update just group file for the group name
b. Syntax to add group if the groupname is samsu
c. How do I find out which GID to use (that is not already in use and is available)

Thank you
Question by:atwork2003
    LVL 48

    Accepted Solution

    How can you have a group called 'samsu' and want to add it?  You can't add a group if it already exists.

    Assuming it doesn't already exist.

    a)  You can edit /etc/group with vi, but better to use groupadd
    b)  groupadd -g <gid> samsu
    c)  cut -f3 -d: /etc/group (choose a GID not listed)

    Author Comment

    thanks a lot, worked great. I have a network of 8 servers. Do I have to run this on each server so the group id stays unique
    LVL 48

    Expert Comment

    Are the group entries the same on all 8 servers?  If so, then you can just use the same GID for all 8 servers.
    LVL 40

    Assisted Solution


    The groupadd command can automatically assign gid to the newly created group, if you do not specify it in the command while creating the group.

    If you want to have same user ids / user names, group ids / group names across the 8 servers, you may use NIS or LDAP. Please see the links below:

    Author Comment

    Thank you so much for all the help:)

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (, discussed installing the Solaris Operating S…
    Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
    This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

    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