0

Background

I have a bunch of OS X Yosemite Mac Minis that are used as slaves by a Jenkins master machine to run Selenium tests using Google Chrome.

These slave machines get restarted on a daily basis.

Problem

After the restart, the machines are at a login screen asking for a username and password. Running Google Chrome remotely on the machines fails until a manual login is performed.

Is there a way to automate this login?

Things I have tried

  1. Executing a login script remotely on the Mac Mini using ssh root@<macmini-address> "bash -s" < ./login.sh where login.sh contains the following:
#!/bin/bash
osascript <<EOF
tell application "System Events"
keystroke "<replace with user>"
keystroke tab
delay 0.5
keystroke "<replace with password>"
delay 0.5
keystroke return
keystroke return
end tell
EOF

This results in the following error:

33:49: execution error: An error of type -10810 has occurred. (-10810)
  1. Sending the above AppleScript to the Mac Mini through Apple Remote Desktop (ARD).

This works but on some occasions, ARD is not able to send the script over to some Mac Minis showing a 'Client Software Not Active' message in the ARD status column.

1

It sounds like you’re just looking for automatic login on OSX.

Go to System Preferences > Login and choose the user to enable automatic login.

https://support.apple.com/en-us/HT201476

| improve this answer | |
  • I did see a handful of suggestions for a command line option when doing a google search containing “automatic login OSx cli”. I can’t verify any of those so I didn’t put them in the answer. – CoreyJJohnson Nov 17 '17 at 2:52

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.