Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
11-11-2005, 09:43 AM
|
#1
|
|
Member
Registered: Apr 2004
Distribution: Gentoo
Posts: 76
Rep:
|
how to add a user to a new group?
Hi all,
this is really a newbie question, but how do I add a user to a new group? For example, I have this user account "john" that is already part of the following groups:
users adm audio wheel
now, I need to add him into the group "video". But if I use "usermod -G", I need to retype all the existing groups. Is there an easier way to just add the new group on top of the existing one? Thanks.
-- eman
|
|
|
|
11-11-2005, 09:58 AM
|
#2
|
|
Senior Member
Registered: Oct 2003
Posts: 3,057
Rep:
|
From the ( man usermod ), try it with -a
-G group1[ ,group2,..., [groupN]]]
A list of supplementary groups which the user is also a member of.
Each group is separated from the next by a comma, with no intervening
whitespace. The groups are subject to the same restrictions as the
group given with the -g option. If the user is currently a member of
a group which is not listed, the user will be removed from the group.
This behaviour can be changed via -a option, which appends user to
the current supplementary group list.
|
|
|
|
11-11-2005, 10:42 AM
|
#3
|
|
Member
Registered: Apr 2005
Location: switzerland
Distribution: debian etch
Posts: 99
Rep:
|
Re: how to add a user to a new group?
first, create the video group
#addgroup video
then,
#adduser emanresu video
|
|
|
|
11-20-2005, 06:38 PM
|
#4
|
|
Member
Registered: Apr 2004
Distribution: Gentoo
Posts: 76
Original Poster
Rep:
|
the -a option doesn't seem to be available on my machine.
|
|
|
|
11-20-2005, 07:35 PM
|
#5
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
You could edit the /etc/group file. Add the user to the end of the line that begins with the the word "video".
|
|
|
|
11-21-2005, 08:18 AM
|
#6
|
|
Member
Registered: Apr 2004
Distribution: Gentoo
Posts: 76
Original Poster
Rep:
|
here is the solution:
Code:
gpasswd -a <username> <groupname>
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 09:35 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|