How can I check and modify /etc/ssh/sshd_config parameters in a script? I'll particular to check and enable / disable PasswordAuthentication and PubkeyAuthentication. I know I can edit sshd_config by vi, but for some reason we need change it in a script.
It did not work. Not clear if we are in the same page. I actually asked how to change the /etc/ssh/sshd_config which defines "PasswordAuthentication no" by command line in script in the remote_vm machine. I guess the ssh -o option is only to change /etc/ssh/ssh_config setting, is it correct?
sshd also supports overriding sshd_config settings with command options.
It may exist, but at the moment I can't envision a scenario where it makes sense to use a script to toggle settings in an important system config file. If the changes are meant to be long lasting, then simply edit the file manually and be done with it. If the overrides are only needed occasionally, it would be simpler and safer to use command options for the job, either to override specific settings in the default config file or to use a different config file altogether.