Yes this is expected behaviour. /etc/group lists secondary group memberships, /etc/passwd (and related files) list the primary groups.
Most of the tools you're using to investigate group membership (groupinfo, getent etc) only list secondary groups. "id katia" is showing first the primary group (gid=31), and then a list of all groups this user has permissions for (either primary or secondary). On 2011-05-07, Michael Sioutis <papito....@gmail.com> wrote: > Hello, > > my OS is OpenBSD 4.9 i386. > > I created a user named 'katia' with adduser and when prompted for > login group I entered 'guest'. > > So, katia seems to be in group 'guest' when running the following commands: >====================================== > pico@hive:~$ id katia > uid=1002(katia) gid=31(guest) groups=31(guest) > > pico@hive:~$ userinfo katia > login katia > passwd * > uid 1002 > groups guest > change NEVER > class > gecos Katia Papakonstantinopoulou > dir /home/katia > shell /usr/local/bin/bash > expire NEVER >====================================== > > BUT when doing: >====================================== > pico@hive:~$ groupinfo guest > name guest > passwd * > gid 31 > members root > > pico@hive:~$ getent group guest > guest:*:31:root >====================================== > > user 'katia' is not listed there, only root. > > I also do: >====================================== > pico@hive:~$ sudo useradd -G guest katia > useradd: already a `katia' user >====================================== > > Is that expected behaviour? I am still a little unfamiliar with > OpenBSD so bare with me. > I should notice I created the user remotely. > > Thank you for any anwers! > MIke