User groups

Hi OpenSuSE users.

I am looking for an advice on how to restore my user access to varies group in OpenSuSE 12.1
Everything started when I tried to add myself to the a group using usermod -G groupname username
as result after issuing that command I got deleted from all the other groups I was already in, and therefore now I have access to nothing in the system.
Can sombody kindly show the proper way to issue the usermod -G command so I can get access to everything again. my linuxbox is an ASUS laptop with CD/DVD, SIM card reader, headphone jack, microphone, usb ports, hdmi, and VGA out pot. I dont know what groups OpenSuSE create by default but I would like to be able to use everything from my user account.

Thank you I appreciate all your help.

On openSUSE (not on other Linuxes) you can use:

groupmod -A someuser somegroup

You should do that as root of course.
To remove a user from a group:

groupmod -R someuser somegroup

On openSUSE, you should have used:

usermod -A groupname username

and on Debian or RedHat based distros:

usermod -a -G groupname username

On 2011-12-01 01:36, please try again wrote:
> and on Debian or RedHat based distros:
>
>
> Code:
> --------------------
> usermod -a -G groupname username
> --------------------
>

What does the -G do on Debian?


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

On 2011-12-01 01:16, Ben0074 wrote:
> I dont know what groups OpenSuSE create by
> default but I would like to be able to use everything from my user
> account.

Just create a new user and verify.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

BOn 11/30/2011 6:16 PM, Ben0074 wrote:
>
> Hi OpenSuSE users.
>
> I am looking for an advice on how to restore my user access to varies
> group in OpenSuSE 12.1
> Everything started when I tried to add myself to the a group using
> -usermod -G groupname username-
> as result after issuing that command I got deleted from all the other
> groups I was already in, and therefore now I have access to nothing in
> the system.
> Can sombody kindly show the proper way to issue the usermod -G command
> so I can get access to everything again. my linuxbox is an ASUS laptop
> with CD/DVD, SIM card reader, headphone jack, microphone, usb ports,
> hdmi, and VGA out pot. I dont know what groups OpenSuSE create by
> default but I would like to be able to use everything from my user
> account.
>
> Thank you I appreciate all your help.
>
>
Ben0074;

Carlos E. R. and please try again have given you the information for using the command line. In
openSUSE you can also use YaST to manipulate groups and users.

YaST > Security and Users > User and Group Management. Here you can create, delete or modify users
and groups.


P.V.
“We’re all in this together, I’m pulling for you” Red Green

From Ubuntu man usermod:

-a, --append
Add the user to the supplementary group(s). Use only with the -G option.

-G, --groups 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 the -a option, which appends the user to the current supplementary group list.

Thank you for your info I did restore the groups and now I am able to use my system as regular user

On 2011-12-01 03:36, please try again wrote:

>> What does the -G do on Debian?
>>
> From Ubuntu man usermod:
>
>> -a, --append
>> Add the user to the supplementary group(s). Use only with
>> the -G option.
>>
>> -G, --groups 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 the -a option, which appends
>> the user to the current supplementary group list.

It is indeed different from what it does on suse:

-G, --groups group,…
With this option a list of supplementary groups can
be specified, which the user should become a member of.
Each group is separated from the next one only by a comma,
without whitespace. The user is removed from all
other groups not specified.

It is similar… hold on, the wording is different, but it does the same
thing, no? With no -a option. In both versions the user is added to those
given groups and deleted from any other group not listed.

I don’t understand why the difference… ah, maybe I do. The manual of our
version is signed by a suse dev, it is not a a generic program. So each
distro may use a different version.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Correct. The -G option does the same. But -a -G on Debian (or others) is the equivalent of -A in SUSE.
There are other differences in usermod, useradd, groupmod, groupadd between SUSE and Debian/Fedora/Arch, basically everyone else.
These commands are not standard under SUSE, not sure what sense it makes (it’s neither better nor worse IMO).

On 2011-12-01 04:46, please try again wrote:
>
> robin_listas;2412810 Wrote:
>>

> Correct. The -G option does the same. But -a -G on Debian (or others)
> is the equivalent of -A in SUSE.

Yep. And -a does not exist in SUSE.

> There are other differences in usermod, useradd, groupmod, groupadd
> between SUSE and Debian/Fedora/Arch, basically everyone else.
> These commands are not standard under SUSE, not sure what sense it
> makes (it’s neither better nor worse IMO).

Tradition, perhaps. They are tools made by the distros, there is no
upstream for them.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

I just found a bug in a script I wrote for Fedora and Debian.

The following command works only with openSUSE’s usermod:

usermod Charly && echo "user Charly exists"