Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
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).
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