Add Guest account created during login to certain groups?
Solution 1:
The guest accounts are created by the shell script /usr/sbin/guest-account
.
At the end of the function add_account
it calls useradd to create the user. If you add the -G plugdev,dialout
option here that should do the trick.
Use dpkg-divert to avoid that an updated package overwrites your modified script.
Solution 2:
Use usermod
, not 'moduser
'.
... so the behavior of the startup script prefs.sh now works as advertised. By creating a file called prefs.sh in /etc/guest-session with the following line:
moduser $USER -a -G plugdev,dialout
That command will cause the guest session to crash and not load if you include it in prefs.sh
. '`moduser' isn't a valid command. Use this line instead:
usermod -a -G plugdev,dialout $USER