How do I add a user to a group from the console?
You can add the user to the specific group directly by editing /etc/group.
or, via commandline:
usermod -G <groupname> <username>
(without the <>'s) This adds an already existing user to another group.
~LV
You can also do it via useradd can't you?
usermod works. I was looking in /usr/sbin/ and noticed a "lusermod". What is that?
Thats interesting, I haven't used that, I see it on my system, but theres no man page for it so I had to look it up. (I LOVE to look stuff up!)
usermod
lusermod
It looks like lusermod comes from this package (on my system) - libuser-0.52 - which apparently is an account maintenance package whereas usermod comes from a package called shadow-utils.
So they're basically two different packages that do ... much the same thing?
Leave it to Linux to give you many different ways to skin a cat. (ugh, isn't that a horrible phrase? LOL).
Oh, except, in lusermod, I didn't see the -G option or anything comparable to it. Just the -g option for changing groups, but no -G for ADDING groups.
I usually just edit /etc/group anyways, LOL.
hmm, interesting. I wonder if there is any difference when using either one. I'm going to give it a try and excellent information!!!
how to maintain user groups in it.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks