The classic way to enable and configure the remote login feature on a Mac is to open System Preferences > Sharing and then enable the feature.
Looking for a more automated approach the following sections will describe or lets say suggest how to achieve the same over Terminal commands.
Compatible Systems
All adjustments as described below have been tested against the following OS version:
OS X 10.11
Useful commands
Command
Description
systemsetup -setremotelogin on
Enable remote login (aka SSH-Server)
dscl . -read /Groups/com.apple.access_ssh
Print the members of the group being allowed to login over SSH (these members correspond to the allowed users under Sharing, but may not be displayed in the GUI)
In case no error is being printed but the full group information then this means any user is being allowed to login via SSH (corresponds to the All Users option under Sharing)
SSH Server configuration via CMD on OS X
Enabling Remote Login
Permissions are being controlled over directory services where simply enabling remote login without any other configuration will allow all users to login remotely
Highly recommended you should limit the allowed users by first enable the access_ssh record: