Fix the default shell

Go with whatever is set by SSH, and fall back to "linux" if the terminal is not available.

This fixes #1975
Merge pull request #1976 from dagwieers/shell-term

Fix the default terminal