LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-19-2004, 01:13 PM   #1
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Rep: Reputation: 45
one user 2 groups


Hi! I want to make a user belongs to two groups...
Do u know how i can do that?

For example the line:
news:x:9:13,25:News system:/etc/news:/bin/bash

Is correct?
 
Old 10-19-2004, 01:19 PM   #2
serz
Member
 
Registered: Apr 2003
Location: Buenos Aires, Argentina
Distribution: Slackware, Gentoo
Posts: 397

Rep: Reputation: 30
Edit /etc/group or use the usermod command.
 
Old 10-19-2004, 01:52 PM   #3
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Original Poster
Rep: Reputation: 45
No u are wrong..... The /etc/group file have nothing to do with that... I need to make a user belongs to one and more groups
 
Old 10-20-2004, 06:11 AM   #4
james.farrow
Member
 
Registered: Mar 2003
Location: UK Darlington
Distribution: Fedora Freebsd Centos
Posts: 296

Rep: Reputation: 31
gpasswd -a <user> <group>

To confirm issue: id <user>
 
Old 10-20-2004, 06:54 AM   #5
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
You can just tack on the usernames to the end of the group line in a comma-separated list. Here's a snippet from my /etc/group file:
Code:
tty::5:hw
wheel::10:root,hw
audio::18:hw,jenny,anders
cdrom::19:hw,jenny,anders
games::35:hw,jenny,anders
cdrw::80:hw,jenny,anders
users::100:games,hw
portage::250:portage,hw
log:x:409:hw,anders
src:x:410:hw,anders
Log out and then log in again to apply the changes.


Håkan

Last edited by hw-tph; 10-20-2004 at 06:57 AM.
 
Old 10-20-2004, 07:33 AM   #6
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
Originally posted by alaios
No u are wrong..... The /etc/group file have nothing to do with that... I need to make a user belongs to one and more groups
Your the one asking the question so why do you attack saying someone is wrong when they are totally right? It is correct to add the users to the group file instead of putting two different gid numbers in the passwd file, which is WRONG!

Don't ask for help if your only going to say the answers provided are wrong unless your totally sure they are!
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
UK Linux User Groups floppywhopper Linux User Groups (LUG) 0 04-14-2005 08:20 PM
user groups technochef Linux - General 2 10-31-2004 04:00 PM
groups for a monitor user pe2338 Linux - Security 5 05-18-2004 01:37 AM
Linux User Groups? gsmonk Linux - General 1 09-01-2003 04:20 PM
a user can be in two groups? joeslazenger Linux - Newbie 2 08-13-2002 01:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:18 PM.

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