After upgrading to Big Sur on my MacBook there are problems connecting to a Linux box it the Linux box has a default shell other than bash. If it has zsh or fish for example you get multiple errors complaining about the LOCALE variables not being set properly. If the box is using bash you can connect and then switch to another shell with no problem.
This just started when I upgraded from Catalina to Big Sur. No problems if I SSH from my Mac Mini which is still running Mojave, so it definitely appears to be due to some change in Big Sur.
Has anyone else seen this? My web searches haven’t turned up anything.
I found a solution, or at least a workaround on this here.
Briefly, you need to edit /etc/ssh/sshd_config on the server, that is on the target Linux system, and change this line
AcceptEnv LANG LC_*
to
AcceptEnv no
Then restart the SSH daemon
sudo systemctl restart sshd
This prevents the server from accepting any of the enviroment variables passed from the client. Apparently something changed with Big Sur in the way it passes the variables to the server.
I’ve tested this with both the Big Sur and Mojave clients and it seems to work in both cases. As for the Linux boxes, they were running Ubuntu 20.04 LTS, and Siduction (based on Debian Sid).
You can also solve this client side in Big Sur, by editing the /etc/ssh/ssh_config file and removing or commenting out the line "SendEnv LANG LC_" so the last part reads:
Host *
# SendEnv LANG LC_