usermod changed?

Hello,

with OS12.3 the syntax of usermod changed?
Where is the option ‘List of groups the user should be removed from’

Is there no concept of primary and secondary groups in OS12.3 anymore?

How can i remove a user from a secondary group without removing the user from
his primary group?

Best regards

> with OS12.3 the syntax of usermod changed?
> Where is the option ‘List of groups the user should be removed from’

i do not have a 12.3 man here, so i am just asking:

does your “man usermod” not include something similar to this:


-R, --remove-from-group group,...
With this option a list of groups can be specified, from which the
user should be removed. Each group is separated from the next one
only by a comma, without whitespace.


dd
http://tinyurl.com/DD-Caveat

Here on 12.3, “man usermod” says:

      **-R, --root** CHROOT_DIR
           Apply changes in the CHROOT_DIR directory and use the configuration
           files from the CHROOT_DIR directory.

Well, AFAIK usermod on openSUSE wasn’t quite standard regarding the command line options. Seems that got changed now.

Regarding the original question:
There still is a “primary group”, see option “-g”.
“-G” only changes the secondary (the manpage says “supplementary”) groups.

Not sure how you could remove a specific group now though.
You could list all other groups with “-G”. (groups not listed are removed)

Well, just found one::wink:
Use gpasswd.

**NAME**       gpasswd - administer /etc/group and /etc/gshadow


**SYNOPSIS**
       **gpasswd** option] group


**DESCRIPTION**
       The **gpasswd** command is used to administer /etc/group, and /etc/gshadow.
       Every group can have administrators, members and a password.
...
**OPTIONS**
       Except for the **-A** and **-M** options, the options cannot be combined.


       The options which apply to the **gpasswd** command are:


       **-a, --add** user
           Add the user to the named group.


       **-d, --delete** user
           Remove the user from the named group.
...


(See man gpasswd)

Yes, this changed from 12. to 12.3. Other Distros have also this behavior.

I tried:


useradd -g workgroup -p "" supervisor

So i got the primary group ‘workgroup’ and the user is a member of.
Adding him to the group dba:


groupadd dba
usermod -G dba supervisor

Then he is a member of ‘workgroup’ as primary group.
‘groups’ show 'supervisor: workgroup,dba

To remove him from only the secondary group ‘dba’ i did:


usermod -G "" supervisor

‘groups’ show ‘supervisor: workgroup’

Looking in YaST i can see supervisors primary group is ‘workgroup’ only

So i think ‘usermod -G’ touches only the supplementary groups.

Best regards

[LEFT][/LEFT]
AfrikaansAlbanianArabicArmenianAzerbaijaniBasqueBelarusianBulgarianCatalanChinese (Simplified)Chinese (Traditional)CroatianCzechDanishDetect languageDutchEnglishEstonianFilipinoFinnishFrenchGalicianGeorgianGermanGreekHaitian CreoleHebrewHindiHungarianIcelandicIndonesianIrishItalianJapaneseKoreanLatinLatvianLithuanianMacedonianMalayMalteseNorwegianPersianPolishPortugueseRomanianRussianSerbianSlovakSlovenianSpanishSwahiliSwedishThaiTurkishUkrainianUrduVietnameseWelshYiddishAfrikaansAlbanianArabicArmenianAzerbaijaniBasqueBelarusianBulgarianCatalanChinese (Simplified)Chinese (Traditional)CroatianCzechDanishDutchEnglishEstonianFilipinoFinnishFrenchGalicianGeorgianGermanGreekHaitian CreoleHebrewHindiHungarianIcelandicIndonesianIrishItalianJapaneseKoreanLatinLatvianLithuanianMacedonianMalayMalteseNorwegianPersianPolishPortugueseRomanianRussianSerbianSlovakSlovenianSpanishSwahiliSwedishThaiTurkishUkrainianUrduVietnameseWelshYiddish[LEFT]Sprache erkennen » German[/LEFT]

I found a bugreport asking to “Remove the Suse usermod command and use world wide standard usermod command!!!”, which was closed as INVALID.
But they seem to have changed it for 12.3 nonetheless…

https://bugzilla.novell.com/show_bug.cgi?id=789608

Yes, that’s exactly what I wrote: :wink:

Also, see my reference to gpasswd…