What happens if a users default shell is not installed?
Let's try!
Shell changed on the server:
[myserver ~]% getent passwd myuser
myuser:x:150:150:myuser:/home/myuser:/foo
Let's log in:
[myclient ~]% ssh myserver
Received disconnect from myserver: 2: Too many authentication failures for myuser
From the SSH logs on the server:
Nov 22 09:30:27 myserver sshd[20719]: Accepted gssapi-with-mic for myuser from myclient port 33808 ssh2
Nov 22 09:30:27 myserver sshd[20719]: pam_unix(sshd:session): session opened for user myuser by (uid=0)
Nov 22 09:31:18 myserver sshd[20727]: Received disconnect from myclient: 11: disconnected by user
Nov 22 09:31:18 myserver sshd[20719]: pam_unix(sshd:session): session closed for user myuser
Nov 22 09:31:20 myserver sshd[20828]: User myuser not allowed because shell /foo does not exist
Nov 22 09:31:20 myserver sshd[20835]: input_userauth_request: invalid user myuser
Nov 22 09:31:20 myserver sshd[20835]: Disconnecting: Too many authentication failures for myuser
Key line: User myuser not allowed because shell /foo does not exist
. So you can't log in if you don't have a valid shell set.
There is no fallback. There would be an error message such as...
Cannot execute /does/not/exist: No such file or directory.
You could add the invocation of zsh
without modifying AD.
echo 'exec zsh' >> ~/.bashrc
Then, every time you log in with bash
, you start zsh
automatically.