I use CentOS 7 and I need to change the file that delivers the SSH configuration /etc/ssh/sshd_config to /etc/ssh/sshd_config_other.

This demand was due to a security automation that always overwrites the sshd_config and I dont have allow to change.

I tested changing the /etc/systemd/system/multi-user.target.wants/sshd.service creating a variable to ExecStart=/usr/sbin/sshd -D $ OPTIONS, but it dosent work.

Does anyone know a way to change the SSH configuration file for /etc/ssh/sshd_config_other ?

1 Answer 1


Note that /etc/systemd/system/multi-user.target.wants/sshd.service is just a link to /usr/lib/systemd/system/sshd.service, and you should change this file by copying it first to /etc/systemd/system/, then editing this copy.

However, if your sshd.service file has the line


then you can simply add to file /etc/sysconfig/sshd a line

OPTIONS='-f /etc/ssh/sshd_config_other'

If you change systemd files you need to sudo systemctl daemon-reload, but I dont suppose you do for this change.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .