Replace the default shell for domain users on Linux

Kovasky Buezo | Apr 2, 2024 min read

edited on: May 17, 2024

Intro

After setting up the AD trust, every time I logged in the shell defaulted to /bin/sh. To change it to /bin/bash or any other shell of your choice you can do the following.

Editing SSSD.conf

Navigate to /etc/sssd/ and open sssd.conf in an elevated text editor. It should look something like

[domain/lin.mydomain.com]
...
use_fully_qualified_names = false

[domain/lin.mydomain.com/win.mydomain.com]
use_fully_qualified_names = false

[sssd]
...

After each domain, add your override shell. Something like:

[domain/lin.mydomain.com]
...
use_fully_qualified_names = false
override_shell = /bin/bash

[domain/lin.mydomain.com/win.mydomain.com]
use_fully_qualified_names = false
override_shell = /bin/bash
[sssd]
...

Restart SSSD service

After the modification has taken place, just restart the service with the following command:

sudo systemctl restart sssd

You’re done! Next time you log in with your domain credentials, your default shell will be overriden.