I'm trying to ssh to my raspberry pi with a camara in it from my main raspberry pi. My goal is to set up a key based authentication between the two so I can have a scheduled video file backup using cron.

My problem of the following, whenever I try to ssh in the pi with the camera I get the following error:

ssh pi@    
/etc/ssh/ssh_config: line 56: Bad configuration option: acceptenv
/etc/ssh/ssh_config: terminating, 1 bad configuration options.    

When I however ssh into the pi with the camera from my desktop (linux mint) I have no problem at all, so apparently the problem is located in the raspberry pi where I try to ssh from.

I've looked on the internet and found the following solution for a similar case: https://serverfault.com/questions/785290/bad-ssh-config-on-remote-server-cannot-login-in

When I however open /etc/ssh/ssh_config and go to line 56, the contents of the line do not correspond to something like 'acceptenv' There is however the following line:

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

but when I add 'yes' to that line and I reboot the problem still remains.

I've also tried adding 'yes' to the same respective line in /etc/ssh/sshd_config but still no luck.

Anyone have an idea how to fix this?

Adittionally, I got the tip to check if the error would presist if I made as loopback connection. Unfortunately it did:

ssh -vv *****@localhost
Raspbian-10+deb9u3, OpenSSL 1.0.2l  25 May 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
/etc/ssh/ssh_config: line 56: Bad configuration option: acceptenv
/etc/ssh/ssh_config: terminating, 1 bad configuration options

Thank you in advance


/etc/ssh/ssh_config is a configuration file for the ssh client. It's read when you run the ssh program. It's documented here.

/etc/ssh/sshd_config (note the "d") is a configuration file for the ssh server. The server handles incoming ssh connection requests from clients. It's documented here.

AcceptEnv is a server configuration option. You can see it documented in the sshd_config documentation. It's not a client configuration option, and it doesn't belong in the client configuration file.

So, remove the AcceptEnv line from ssh_config. You can add it to the sshd_config file on each server, if it's not already present.

  • Ha that worked thanks! But then the question becomes, how did the configuration line end up in ssh? And how come the raspberry pi itself looks for the configuration setting in lowercase rather than the uppercase? That's weird right? – Johan Antonissen Mar 28 '18 at 6:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.