Adding group to group file in Solaris 9 UNIX

Posted on 2007-10-08
Medium Priority
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
  • 2
  • 2
LVL 48

Accepted Solution

Tintin earned 1600 total points
ID: 20036964
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

ID: 20037061
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

ID: 20037229
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

omarfarid earned 400 total points
ID: 20042600

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

ID: 20045858
Thank you so much for all the help:)

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
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.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month16 days, 4 hours left to enroll

850 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