I know how to turn on SSH server from System preferences :-
(System preferences -> Sharing -> Remote Login )
Now I am looking for a terminal command for the same.
By knowing it I can use the command in my Python Script (for project work).
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
You can stop the ssh service by typing the following:
$ sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist
To start it again, use this:
$ sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist