Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

HBar Strategist

macrumors newbie
Original poster
Jan 8, 2011
2
0
First, enable hidden items using tinkertool (under general preferences) or the terminal command
"defaults write com.apple.Finder AppleShowAllFiles YES"
Then, follow the steps below in order to get applescript (or automator, or any other scripting application) to recognize that ssh-askpass exists.
1. in terminal, run "sudo vi /usr/libexec/ssh-askpass"
2. get info for /usr/libexec/ssh-askpass, it should be called
.ssh-askpass.swp
3. add your user as having read and write privileges using the admin password
4. open .ssh-askpass.swp and copy the text below
"#! /bin/sh # # An SSH_ASKPASS command for MacOS X # # Author: Joseph Mocker, Sun
Microsystems # # To use this script: # setenv SSH_ASKPASS "macos-askpass" # setenv
DISPLAY ":0" # TITLE=${MACOS_ASKPASS_TITLE:-"SSH"}

DIALOG="display dialog \"$@\" default answer \"\" with title \"$TITLE\""
DIALOG="$DIALOG with icon caution with hidden answer"

result=`osascript -e 'tell application "Finder"' -e "activate" -e "$DIALOG" -e 'end
tell'`

if [ "$result" = "" ]; then exit 1 else echo "$result" | sed -e 's/^text
returned://' -e 's/, button returned:.*$//' exit 0 fi"
5. Save the file, you may need to enter the admin password
6. in a new terminal window, enter "sudo chmod +x /usr/libexec/.ssh-askpass.swp"
7. then enter "sudo mv /usr/libexec/.ssh-askpass.swp /usr/libexec/ssh-askpass"
applescript should now recognize that ssh-askpass exists
Adapted from "http://cakealot.com/2009/04/fixing-missing-ssh-askpass-on-macos-105/"
The guide cited is useful, however it confuses the name of the ssh-askpass file when making it a unix executable file.
The terminal commands must be in the format stated in my version of the guide (on 10.6 anyway), and the syntax of the sudo chmod +x command must be "sudo chmod +x /usr/libexec/.ssh-askpass.swp," not sudo chmod +x /usr/libexec/ssh-askpass" as stated by Kjell's guide on cakealot.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.