How to enable and disable remote terminal login (or applescript)
1 answer
I haven't fully tested, but I think they will work as early as 10.4. To enable remote login (ssh):
sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist
To turn it off:
sudo launchctl unload -w /System/Library/LaunchDaemons/ssh.plist
Please note that they do not configure the service access control list, i.e. what accounts are allowed for ssh. This is controlled by membership in a hidden system group named "com.apple.access_ssh" (long name: "Remote ACL ACL").
+4
source to share