Changing the primary group
Laszlo Papp
lpapp at kde.org
Tue Feb 17 12:46:19 UTC 2015
On Tue, Feb 17, 2015 at 12:38 PM, walter harms <wharms at bfs.de> wrote:
>
>
> Am 17.02.2015 12:59, schrieb Laszlo Papp:
>> Hi,
>>
>> I am looking for something like usermod -g on desktop. Is it possible
>> to achieve this feature?
>
> I have no idea why you need "usermod -g" (i assume adding a group)
> i use
> vi /etc/group
1) If you have no idea, you can read the email subject: Changing the
primary group
2) Primary groups ends up /etc/passwd, not /etc/group.
Correspondingly, it is the wrong place to look at.
>> There are workarounds like adding a group and then removing the
>> previous, etc, but it is suboptimal.
>
> mmmg, changing the primary group is changing the id in the 4th field.
> see: man 5 passwd
I know, but that is not the point of the question.
1) Editing files manually are bad habit without avoiding race, etc. It
is also error-prone. You could say the same for pretty much any passwd
and group related issues that you can add a group manually.
2) It is not enough to just look up man 5 passwd. Eventually, you
would need to get the group id out of the groupname. I definitely do
not want to supply raw group ids. That is mad. :-)
Since it was not clear, I will try to clarify: is this feature already
available in busybox via one-pass? My suggested workaround is still
nicer than editing files manually like that in my opinion, but it is
two-pass.
More information about the busybox
mailing list