CLI Commands to Turn File Sharing on/off From the Terminal?

Posted:
in macOS edited January 2014
Is there a way to SSH into my OS X File Personal FIle Sharing Server (Jag) from another Mac (also Jag) and turn File Sharing on and off remotely?



I will by Apple Remote Desktop for X soon, but until then I would like to learn a way without a GUI...

Comments

  • Reply 1 of 1
    serranoserrano Posts: 1,806member
    Applescript it, then call it in a script. Actually doesn't Apple Events do just this? Help Center is your friend... here is an excerpt.



    [quote]You can send remote Apple events to or from Mac OS X computers using TCP/IP. You can't send events through AppleTalk.



    To send an Apple event to a remote computer, you must identify the target computer in your script as shown here:



    Tell application "nameOfApp" of machine "eppc://..."



    To enable program linking and allow other Mac OS X users to send Apple events to your computer, open System Preferences and click Sharing. Click the Services tab and select Allow Remote Apple Events.



    If you also want to allow Mac OS 9 users to use remote Apple events, select the Remote Apple Events item in the list and select "Allow events from Mac OS 9." The first time you select this option, you must set a password. If you want to change the password later, click Set Password.<hr></blockquote>



    I'm going to guess you're going to be scripting the Finder, check out its Apple Script Dictionary.
Sign In or Register to comment.