my user belongs to some groups:
$ id
uid=1000(user) gid=1000(user) groups=1000(user),1003(shared)
Now I have a program running in bwrap/bubblewrap. I can tell the program to create files as a specified group, but in bubblewrap all groups are truncated:
$ bwrap --ro-bind / / id
uid=1000(user) gid=1000(user) groups=1000(user),65534(nobody)
For me, it would be ok if the program in bwrap has a group I can specify, e.g.
bwrap --gid 1003
, but this also creates files as group 1000.
Is there anything I can do to change the main group to another group I belong to? (Probably before the bwrap call)
The newgrp
command can be used to get a shell, in scripts sg
can be used.
(Thank you to Cyrus)