command needed to remotely login to multiple machines using ARD

Hi Everyone,

Is there a Unix command that I can send to 33 machines at once using ARD, which will tell remote machines to login automatically?

Thanks,

Here’s what I use:

osascript -e ‘tell application “System Events” to keystroke “account”’;
osascript -e ‘tell application “System Events” to keystroke tab’;
osascript -e ‘tell application “System Events” to delay 0.5’;
osascript -e ‘tell application “System Events” to keystroke “password”’;
osascript -e ‘tell application “System Events” to delay 0.5’;
osascript -e 'tell application “System Events” to keystroke return

Of course you’ll need to substitute “account” with the name of your own, and “password” with your specific info.

I have tried this command and it sits there and nothing happens. Does it matter if I am running Tiger or Leopard on target machine?

Thanks,

I’ve read that this only works on Tiger. Which machine is it not working for you?

Edit : More reliable sources have confirmed that this script can work on Leopard. This is the current incarnation going around

osascript <<EndOfMyScript
   tell application "System Events"
       keystroke "LOGIN_NAME"
       keystroke return
       delay 3.0 
       keystroke "PASSWORD"
       delay 3.0 
       keystroke tab
       keystroke return
       keystroke return
   end tell 
EndOfMyScript

Note however there appears to be an issue with later builds of Tiger on Intel platforms. So if you are still having trouble please provide the OS/Hardware/And specific behavior.

Using ARD, all I did selected a target machine (Leopard) and then choose “send UNIX command” and pasted the following script in the window:

osascript -e ‘tell application “System Events” to keystroke “account”’;
osascript -e ‘tell application “System Events” to keystroke tab’;
osascript -e ‘tell application “System Events” to delay 0.5’;
osascript -e ‘tell application “System Events” to keystroke “password”’;
osascript -e ‘tell application “System Events” to delay 0.5’;
osascript -e 'tell application “System Events” to keystroke return

And of course account and password info with built in local account and password.

Once I click send, it shows that it is working but then after 5 mins, it will report back with timeout error. I have tried your apple script and it does the same thing.

Am I using correct method to send these command to target machines?

Thanks,

Hey music,

I saw you also posted this on macosxhints.com (in which I just replied). On this site though there’s less yellow tape with moderator approval (although this is a very legit site nonetheless) so this will post immediately and hopefully get you results.

Anyways this is what I’m using in the lab (just figured it out moments ago) for remote student login via ARD 3.2 (clients have ARD client 3.2.2) through a UNIX command user “root”:

osascript -e ‘tell application “System Events” to keystroke “USERNAME”’;
osascript -e ‘tell application “System Events” to keystroke tab’;
osascript -e ‘tell application “System Events” to keystroke return’;
osascript -e ‘tell application “System Events” to delay 1’;
osascript -e ‘tell application “System Events” to keystroke “PASSWORD”’;
osascript -e ‘tell application “System Events” to keystroke return’; \

OBVIOUSLY CHANGE THE USERNAME AND PASSWORD TO THE SETTINGS IN YOUR ENVIRONMENT

Good luck :slight_smile:

Thanks Antnee,

I have found that login script and it works for me. Also I have found a secure way to login to remote machine using following script:

This script is more secure than just regular osascript. If anyone want to know more detail then check this link:

http://discussions.apple.com/thread.jspa?threadID=1714777&tstart=50

Thanks,