Set samba "template shell" dependent on group

I want to give users with a G-GROUP-MENU group who log in with ads not the bash shell but a menu.

Thought of “username map script” but that isn’t appealing to me.

so what I ask:
template shell = /bin/bash
but when the user has an ads group G-GROUP-MENU then
template shell = /usr/local/bin/menu

Login where ?

Sorry but you cannot abuse ‘login shell’ in the way you suggest and using ‘username map script’ will not work either.

If you are talking about when a user logs in through lightdm etc, then you could run an autostart script.

Thanks .

ssh Login any linux box.

Then I have to go for the abuse and create a login script and set template shell = /path/myloginscript ?
Seems to me the best way.

It must also work when somehow the user has no $HOME

I think you misunderstood me, you cannot do this, from ‘man smb.conf’

    template shell (G)

        When filling out the user information for a Windows NT user, the
        winbindd(8) daemon uses this parameter to fill in the login 

for that user.

        Default: template shell = /bin/false

It will not run a script.

You seem to want to run a script when the user logs in, You could try
searching on ‘.bashrc’ or ‘.bash_profile’ or ‘pam_script’

Also your user must have a home directory or they will not be able to login.

“template shell = /path/myscript” works. It runs the script and normal command prompt users won’t even notice but menu users will get their menu.

When a user has no HOME dir the user can log in fine en will be reverted to “/” after login.