Updating this post after 11years !!
Anyone who is still seeking for a solution to customize sshd_config.
Problem: Due to security requirements in my workplace, and not being able to upgrade vyos 1.3.2 to latest versions, I had to modify ssh daemon config to strip the depricated algorithms from sshd config.
By default, vyos does support a wide ranges of algorithms, but security won’t allow keeping SHA-1 mostly.
Also vyos cli config mode will allow to select algorithms for kex, mac, ciphers but not HostKeyAlgorithms.
set service ssh [TAB]
Possible completions will not show HostKeyAlgorithms
By default, supported HostKeyAlgorithms are:-
rsa-sha2-512, rsa-sha2-256, ssh-rsa, ecdsa-sha2-nistp256, ssh-ed25519
This requires direct modification of the /etc/ssh/sshd_config file. and then restart ssh service.
But if we reboot the router for any case, this change will wipe out as the reboot will load the fresh router image into running config.
Procedure:
1.Save sshd_config in the file.
Using your favorite editor, add the following entry to /etc/ssh/sshd_config:
HostKeyAlgorithms any_desired_Algo_for_example ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256
sudo service ssh restart
2.Persist the change to survive reboot.
Edit /opt/vyatta/share/vyatta-cfg/templates/service/ssh/node.def
My original file looked like this -
priority: 1000
help: Secure Shell (SSH)
end: sudo sh -c “${vyshim} ${vyos_conf_scripts_dir}/ssh.py”
And I have modified to this-
priority: 1000
help: Secure Shell (SSH)
end: sudo sh -c “${vyshim} ${vyos_conf_scripts_dir}/ssh.py”
------STR=“HostKeyAlgorithms paste your desired algorithms here”
------sudo sh -c “echo -e ‘# new custom config for HostKeyAlgorithms\n \n’ >> /etc/ssh/sshd_config”
------sudo sh -c “echo ‘$STR’ >> /etc/ssh/sshd_config”
----- sudo /usr/sbin/invoke-rc.d ssh restart
careful about the indentation, all lines need be aligned after "end: "
Thats it.
I appreciate all the helpful posts from this forum which worked a guideline for me to solve my problem.
Cheers!