While trying to enable root logins on NSX managers by editing /etc/ssh/sshd_config, the ssh service stops working.
If the active ssh session disconnected, connect to the vm's console in vCenter, and log in as root from there.
After the edits, service ssh start throws errors similar to:
Unable to start ssh, exiting with an exit code.
More info prompts for journald and xjournal to be run, both of which just repeat the same error, possibly with an actual exit code, but nothing useful.
VMware NSX
VMware ESXi
Other unix based Products.
If there is unknown information in the config file, sshd will crash as it will be seen as an unknown option.
To debug WHY the sshd process is not starting just execute sshd using it's full path.
To find the full path use the which command, then just type the full path that is returned, sshd will give a helpful hint as to why it's not starting:
#which sshd
/usr/sbin/sshd
#/usr/sbin/sshd
Starting OpenBSD Secure Shell server: sshd/etc/ssh/sshd_config line 123: no argument after keyword "ccda"
Here it is seen that line 123 has some garbage text that is not a valid config option. The sshd_config file just needs editing to remove the offending text, or if unsure what it is, then to be safe the line can just be commented out by adding a hashtag as the first character of the line.
Above: Before fixing the file. Below After fixing the file with a hashtag.
Save the file. Run the full path again:
#/usr/sbin/sshd
#
If no errors appear, it has started. It is now possible to test by using the service command:
#service ssh start
#service ssh status
The results should show that the ssh service is started.
This can be verified by ssh-ing into the host in question, and logging in as root.