$ sudo groupadd group1
$ sudo usermod -g group1 $USER
$ id $USER
uid=1000($USER) gid=1001(group1) groups=1001(group1),10(wheel),1000($USER)
$ echo test > /tmp/test.1
$ chown :group1 /tmp/test.1
chown: changing group of '/tmp/test.1': Operation not permitted
Moreover the inital example I gave is a minimal reproducible example for a use case I have. The use case is to change the group of files from the default group to another group that more than one users are members of. I 'd like to be able to do that without having to change a user’s primary group.
The weird thing is that I have only encountered this bug(?) within a toolbox. Performing the same tasks within a podman fedora container succeeds without a problem.
Is it intentional from toolbox to do that, and if so why?