如何在MacOSX Leopard中激活ssh-agent确认?

我有MacOSX Leopard(10.6.2)的MacBook,我用SSH连接到一些服务器(他们的操作系统是Debian Lenny)。 我使用RSA密钥login到服务器A ,并从那里“反弹”到其他服务器BCD. 我已经在服务器A的笔记本电脑的.ssh/config激活了代理转发,以便能够连接到A ,然后从ABCD “跳动”,而不必每次input密码。 它工作正常。

但是我看到代理转发有一个安全缺陷:如果黑客在服务器A上获得root权限,他将能够劫持代理转发机制,并连接到服务器BCD,而不需要任何密码。

显然,一个解决scheme是使用ssh-add-c选项:每次服务器A想要使用我的RSA密钥时,都要求我确认。 但由于某种原因,它失败了:

 miniquark@mylaptop:~$ ssh-add -c Enter passphrase for /Users/miniquark/.ssh/id_rsa: Identity added: /Users/miniquark/.ssh/id_rsa (/Users/miniquark/.ssh/id_rsa) The user has to confirm each use of the key miniquark@mylaptop:~$ ssh serverA Agent admitted failure to sign using the key. miniquark@serverA's password: 

通常,我不需要手动启动ssh-add ,因为当我启动一个需要RSA密钥的ssh连接时,MacOSX会自动为我启动。 所以也许解决办法是configurationMacOSX来启动带-c选项的ssh-add 。 不幸的是,我找不到这个选项。

如果您有任何其他想法可以保护我免受代理转发劫持,我将非常感激。

谢谢。

代理尝试运行帮助程序来提示。 在OS X上这是默认情况下,所以你需要提供一个(在/ usr / libexec / ssh-askpass)。 我目前正在使用一个类似这样的:

 #! /bin/sh # # An SSH_ASKPASS command for MacOS X # # Based on script by Joseph Mocker, Sun Microsystems TITLE=${MACOS_ASKPASS_TITLE:-"SSH Agent"} DIALOG="display dialog \"$@\" buttons {\"Deny\", \"Allow\"} default button 2" DIALOG="$DIALOG with title \"$TITLE\" with icon caution" result=`osascript -e 'tell application "Terminal"' -e "$DIALOG" -e 'end tell'` if [ "$result" = "button returned:Allow" ]; then exit 0 else exit 1 fi