LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 05-02-2012, 04:08 PM   #1
durus123
LQ Newbie
 
Registered: Dec 2006
Posts: 6

Rep: Reputation: 0
newgrp command - how to change effective gid


Hi

In RHEL5, is there a way to change my effective gid?

In Solaris, I changed my effective gid with the newgrp command:
newgrp <gid>

On RHEL5, the newgrp command prompts me for a password.

[cathy@foo ~]$ groups
wheel webadm
[cathy@foo ~]$ newgrp webadm
Password:


It doesn't accept my password, and there is no password set on the group. I'd prefer a way to change my effective gid without having to enter a password.

Thanks.


Regards,

Cathy Smith
 
Old 05-02-2012, 04:47 PM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
Modify the /etc/group file. Add the additional users as a comma seperated format after the last colon of the file. In the future you can specify which groups a user should belong to with the 'useradd' command and the -G option.

Code:
NAME
       group - user group file

DESCRIPTION
       /etc/group  is  an ASCII file which defines the groups to which users belong.  There is one entry per line, and each line
       has the format:

              group_name:passwd:GID:user_list

       The field descriptions are:

       group_name
              the name of the group.

       password
              the (encrypted) group password.  If this field is empty, no password is needed.

       GID    the numerical group ID.

       user_list
              all the group memberâs user names, separated by commas.


---------- Post added 05-02-12 at 02:48 PM ----------

Also, the /etc/password file has the primary GID of the user assigned there. So if you want to change their primary group you will need to modify that to the numerical GID of the group. The first post will let you add supplementary groups to your user.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Remote command execution via SSH and newgrp command SuperMegaMau Linux - General 4 05-13-2011 07:31 AM
Ream and effective uid gid palisetty_suman Linux - Newbie 2 02-14-2009 03:08 AM
difference between gid and effective gid zahidul Linux - Newbie 1 10-01-2008 10:44 AM
smbnull gid change kaplan71 Other *NIX 0 03-16-2007 09:30 AM
newgrp command within perl/csh script bobsey Programming 1 04-13-2001 10:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 12:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration