Search code examples
unixredhatsshd

What is the difference b/w sshd_config and sshd command?


I changed my sshd_config file to set strictmodes to no and then restarted the sshd service. However, I am getting two different outputs as shown below.


root@localhost httpd]# service sshd stop
Stopping sshd:                                             [  OK  ]
[root@localhost httpd]# service sshd start
Starting sshd:                                             [  OK  ]
[root@localhost httpd]# sudo cat /etc/ssh/sshd_config | grep StrictModes
#StrictModes no
[root@localhost httpd]# sshd -T | grep strictmodes
strictmodes yes

Solution

  • The most of the configuration files have # as a comment and therefore the options behind it are not used and therefore your server is using its defaults, which is yes. Change the line in your sshd_config to

    StrictModes no
    

    and restart the service. It will be applied.