Well, for an unknown reason the file
/etc/group has been cleared during a ssh session last week. As I manage ssh with
allowgroups sshusers I could no more log in, but could however use the current session to modify
allowusers so I can still log in.
I first though the problem came from command
sudo addgroup user group I entered instead of
sudo adduser user group, because group was void just after this. But after retrying it seems both commands are equivalent. So to be completely honnest,
/etc/group is not void but contains only the last created groups. After those commands :
$ sudo adduser crashdebug $ sudo adduser helloworld testing $ sudo addgroup helloworld testing $ sudo deluser helloworld testing
I got this (first line is blank) :
$ sudo cat /etc/group crashdebug:x:1000: testing:x:1001:helloworld
$ groups pi && groups crashdebug && groups helloworld pi : crashdebug crashdebug : crashdebug helloworld : groups: cannot find name for group ID 1004 1004 testing $ id pi && id crashdebug && id helloworld uid=1000(pi) gid=1000(crashdebug) groups=1000(crashdebug) uid=1005(crashdebug) gid=1000(crashdebug) groups=1000(crashdebug) uid=1004(helloworld) gid=1004 groups=1004,1001(testing) $ getent group crashdebug:x:1000: testing:x:1001:helloworld
/etc/passwd including all created users :
$ cat /etc/passwd | grep /bin/bash root:x:0:0:root:/root:/bin/bash pi:x:1000:1000:,,,:/home/pi:/bin/bash nix:x:1001:1001:,,,:/home/nix:/bin/bash autossh:x:1002:1002:,,,:/home/autossh:/bin/bash adminmiaou:x:1003:1003:,,,:/home/adminmiaou:/bin/bash helloworld:x:1004:1004:,,,:/home/helloworld:/bin/bash crashdebug:x:1005:1000:,,,:/home/crashdebug:/bin/bash
I have no idea what is going on here. Maybe the problem is sd card corruption because
/etc/group- is filled with binary dump and
/var/log/auth.log to a great extent too.
Anyway, apart the above problems, the Raspberry still works without much issues, though I would not dare to restart it.
pi is still sudoer, though it belongs only to group
crashdebug which is not sudoer (tested), even after re-logging/re-sshing
pi is still sudoer, how is it possible ???
Has anybody any idea how to address this issue ?