Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-08-2003, 03:23 PM
|
#1
|
Member
Registered: Oct 2002
Posts: 32
Rep:
|
Adding new group to existing user
Hi,
I want to add more than one group to existing user, what command should I use?
Thanks
Alf
|
|
|
07-08-2003, 03:29 PM
|
#2
|
LQ Guru
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141
Rep:
|
usermod
See
man usermod
info usermod
|
|
|
07-08-2003, 03:40 PM
|
#3
|
LQ Guru
Registered: Jan 2001
Posts: 24,149
|
FYI, You can also just add them to the group by editing /etc/group
|
|
|
07-08-2003, 04:00 PM
|
#4
|
Member
Registered: Oct 2002
Posts: 32
Original Poster
Rep:
|
usermod works perfect, but it wouldn't let me add more than one group in the same command
usermod oracle -G oracle, dba
wouldn't work, I have to do it in two steps
usermod oracle -G oracle
then
usermod oracle -G dba
why is that?
Alf
|
|
|
07-08-2003, 04:14 PM
|
#5
|
LQ Guru
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141
Rep:
|
From man usermod:
Code:
-G group,[...]
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
Can you figure out what you did wrong now?
|
|
0 members found this post helpful.
|
07-08-2003, 04:15 PM
|
#6
|
LQ Guru
Registered: Jan 2001
Posts: 24,149
|
What's the errors you get? Make sure the group actually exists as well.
|
|
|
07-08-2003, 04:28 PM
|
#7
|
LQ Newbie
Registered: Jun 2003
Distribution: RH9, Gentoo, Slack
Posts: 23
Rep:
|
Looking at the code that you used
Quote:
usermod oracle -G oracle, dba
|
it looks like you have a space between the comma and dba. I could be wrong, but I think that you have to omit whitespace.
|
|
|
05-08-2006, 09:35 PM
|
#8
|
LQ Newbie
Registered: May 2006
Posts: 1
Rep:
|
The correct syntax is
usermod -G <group> <user>
or
usermod -G <group>,<group> <user>
|
|
|
All times are GMT -5. The time now is 11:19 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
|
|