|
|
#1 |
|
Hall of Famer
Join Date: Jan 2002
Location: New York City
Posts: 3,003
|
AppleScripting Terminal to SSH: the bloody password
The only AppleScript routine I have at my fingertips for having an AppleScript-capable application cause Terminal to make an SSH connection to our server is using
Code:
do script "ssh 192.168.xx.yyy" in Window 1 wait 4 do script "thePassword" in Window 1 Under MacOS 9, where I'm doing it via the program MacSSH PPC, I create the connection via AppleScript step 'getURL ssh UserName:thePassword@192.168.xx.yy' and no matter what happens the password never appears in plain text in the window. I've tried 'do script ssh UserName:thePassword@192.168.xx.yy' under OS X but that doesn't fly. Advice? Is there some way I can turn 'echo off' until I've made a connection, maybe? |
|
|
|
|
|
#2 |
|
All Star
Join Date: Apr 2003
Location: OH
Posts: 934
|
|
|
|
|
|
|
#3 |
|
Hall of Famer
Join Date: Jan 2002
Location: New York City
Posts: 3,003
|
Wouldn't the tendency/ability of people to see the key being sent = an ability to establish the same connection manually sending the same lines they say onscreen?
|
|
|
|
|
|
#4 |
|
Hall of Famer
Join Date: Jan 2002
Location: New York City
Posts: 3,003
|
Never mind. When all else fails, try the obvious and have the Mac do what you'd do yourself —
If contents of window 1 contains "password" then {do script "thePassword" and then do other stuff} else display dialog "Connection failed" buttons ["damn"] End If |
|
|
|
|
|
#5 |
|
League Commissioner
Join Date: Sep 2004
Location: Las Vegas
Posts: 5,875
|
You might want to place the test into a wait loop to exit when the word 'password' appears or it times out.
__________________
Las_Vegas -- Ts'i mahnu uterna ot twan ot geifur hingts uto. -- Sometimes I wonder… Why is that Frisbee getting Larger? …and then it hits me. -- Disposable thumbs make me specialer than most animals… |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|