OS X : Terminal command to turn ON/OFF SSH server
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