[ILUG] adding users to groups

Brian Foster blf at utvinternet.ie
Fri Feb 29 19:24:53 GMT 2008


  | Date: Fri, 29 Feb 2008 09:27:47 +0000
  | From: "Lisa Muir" <34.24.34 at gmail.com>
  | 
  | On Fri 29 Feb 2008, Brian Foster wrote:
  | >  | Date: Fri, 29 Feb 2008 06:10:54 +0000
  | >  | From: "Lisa Muir" <34.24.34 at gmail.com>
  | >  |[ ... ]
  | >  | I can hand edit /etc/group to add [a new user to an existing group].
  | >  | but I'd like to do it through groupadd or useradd.  [ ... ]
  | > 
  | > `useradd -G ...'  or  groupmod(8) ?
  | 
  | Looked at both of these before posting, groupmod lets you change group
  | names and group id's and not add users to groups,

 on my SUSE 9.1 box `groupmod -A USER GROUP' is documented
 as adding USER to GROUP.  but I did not see this option on
 Ubuntu 7.10, where `gpasswd' looks like the command to use.

  |                                                           useradd -G
  | would change apache from one group to another without leaving them in
  | the existing group unless all existing groups were specified... or
  | that could be just my bad interpretation of the man file.

 you should not be using `useradd/ on an existing user!
 you should only run it once, to create a new user.
 that is, you specify, using `-G ...', the groups you want
 the new user to be in.  (it is clearly possible there's
 another Ubuntu/SUSE difference here; I didn't check?)

  | On Fri, Feb 29, 2008 at 8:04 AM, Paul Mullen wrote:
  | > gpasswd -a <username> <group>
  | >
  | > gpasswd(1)

 as a point of interest, this command does not seem to
 exist on SUSE 9.1, albeit it does on Ubuntu 7.10; i.e.,
 another distro/version/something difference here.
 ( as a Wild Guess, and keeping in mind the age of
  SUSE 9.1, I'd guess these differences are a LSB
  issue; i.e., Ubuntu follows the LSB whilst the SUSE
  in question is "too old". )

cheers!
	-blf-
-- 
“How many surrealists does it take to    |  Brian Foster
 change a lightbulb?  Three.  One calms  |  somewhere in south of France
 the warthog, and two fill the bathtub   |     Stop E$$o (ExxonMobil)!
 with brightly-coloured machine tools.”  |       http://www.stopesso.com



More information about the ILUG mailing list