Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
LostBoY
Advisor
Jump to solution

ssh config reset after reboot

I made certain changes in /etc/ssh/sshd_config file in my R81.20 mgmt server. However it does not survive reboot and resets to default state. Is there any command to make it permanent ? i never encountered this in R80.40

0 Kudos
1 Solution

Accepted Solutions
PhoneBoy
Admin
Admin

From R80.40 JHF 83, you will need to make any manual changes to sshd_config in the following file: /etc/ssh/templates/sshd_config.templ 
This is required since it is possible to change certain SSH settings from clish/WebUI.
The above file is the "template" the actual sshd_config is generated from.
It's a much better solution than setting the immutable bit on sshd_config itself.

View solution in original post

3 Replies
Vladimir
Champion
Champion

chattr +i /etc/sshd/sshd_config

 

PhoneBoy
Admin
Admin

From R80.40 JHF 83, you will need to make any manual changes to sshd_config in the following file: /etc/ssh/templates/sshd_config.templ 
This is required since it is possible to change certain SSH settings from clish/WebUI.
The above file is the "template" the actual sshd_config is generated from.
It's a much better solution than setting the immutable bit on sshd_config itself.

Tobias_Moritz
Advisor

And don't forget to translate the template after editing the template file:

/bin/sshd_template_xlate < /config/active

before reloading sshd.

Mentioned e.g. in sk106031.

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    Tue 18 Mar 2025 @ 09:30 AM (EET)

    CheckMates Live Greece

    Tue 25 Mar 2025 @ 12:00 PM (MDT)

    Salt Lake City: CPX 2025 Recap

    Tue 08 Apr 2025 @ 12:00 PM (MDT)

    Denver: CPX 2025 Recap
    CheckMates Events