0

I have physical access to a Mac Pro, but it has no monitor and I want to access it remotely. I don't know what state the Mac was left in (network connection, sharing prefs, etc). I am pretty sure I can open up a terminal window and execute a script without actually seeing what I am doing, just using the keyboard. Can someone help me with creating a script that will verify wifi is turned on, connect to a protected wifi network and enable remote management/login so I can VNC in?

Well since I didn't get any responses I did some googling and came up with the following:

To enable screen sharing I used

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -clientopts -setvnclegacy -vnclegacy yes -clientopts -setvncpw -vncpw mypasswd -restart -agent -privs -all

To turn on airport I used

networksetup -setairportpower airport on

To connect to a specific network I used

networksetup -setairportnetwork en2 "$NETWORKNAME" $PASSWORD

It's worth noting that since the Mac Pro has two Ethernet ports, the Airport interface is en2, not en0 or en1.

  • You should convert the solution you found into an answer, then accept it. – Gordon Davisson Aug 4 '15 at 18:27
1

To enable screen sharing I used

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -clientopts -setvnclegacy -vnclegacy yes -clientopts -setvncpw -vncpw mypasswd -restart -agent -privs -all

To turn on airport I used

networksetup -setairportpower airport on

To connect to a specific network I used

networksetup -setairportnetwork en2 "$NETWORKNAME" $PASSWORD

It's worth noting that since the Mac Pro has two Ethernet ports, the Airport interface is en2, not en0 or en1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.