11

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).

  • I am new to all this. I didn't know launchd and 'starting SSH from Terminal' are correlated. And there are thousands of generic questions like these which are asked in different ways. – kshikhar May 3 '16 at 13:35
17

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 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .