How to set KexAlgorithms in /etc/ssh/sshd_config

I tried to modified the file /etc/ssh/sshd_config, but it gets reset back to original after the instance is rebooted.

I need to have the setting in order for my Jenkins to be able to remotely execute shell script on the instance.

If this is not the right way to do it, is there an alternative way to change the sshd_config with Rancheros?

How about starting a new container which has SSH with all the settings you want and then connect to that via Jenkins instead?

There’s a related issue around being about to customize the sshd config file ( For your use case though, I think the solution proposed by @stuart is the best choice.

If you’re handy with sed, you can do this in your configuration’s runcmd section. I’m using this, for example, to change the port that sshd listens on:


  • [ sed, -i, -e, “/^#*[\s]Port\s./s//Port 1022/”, /etc/ssh/sshd_config ]

I’m not certain, but this may require RancherOS v0.7.1 or later due to changes in how the configuration is loaded.