I need to add a user (via cron task) to add a user to a group, then subsequently remove them. I am using it to add a user via time. I have a cron job set up and working that adds them via command line, but that's obvoiusly bypassing things and I need to do it via the accounts database.
At the moment I use
usermod -G shared,library,banned mike
so that mike gets put in the banned group as well as has access to his home folder and the library ibay. Then later on I use
usermod -G shared,library mike
to take him out of the group.
The banned group does not have internet access. Thus (as I am using PAM authentication) I need to use the accounts properties somehow. When I use db accounts show mike
I don't see mikes group membership.
How should I be doing this ?