Min*_*ark 7 ssh mac-osx agent forwarding
我有一台装有 MacOSX Leopard (10.6.2) 的 MacBook,我用它通过 SSH 连接到一些服务器(他们的操作系统是 Debian Lenny)。我使用 RSA 密钥登录到服务器A,然后从那里“弹跳”到其他服务器B、C和D。我在我的笔记本电脑中.ssh/config为服务器A激活了代理转发,以便能够连接到A,然后从A到B、C或D “反弹” ,而不必每次都输入我的密码。它工作正常。
但是我读到代理转发有一个安全漏洞:如果黑客root访问服务器A,他将能够劫持代理转发机制并连接到服务器B、C和D ,而无需任何密码。
显然,一种解决方案是使用ssh-add's-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:
Run Code Online (Sandbox Code Playgroud)
通常,我不需要ssh-add手动启动,因为当我启动需要 RSA 密钥的 ssh 连接时,MacOSX 会自动为我启动。因此,也许解决方案是将 MacOSX 配置为ssh-add使用该-c选项启动。不幸的是,我就是找不到那个选项。
如果您有任何其他想法可以保护我免受代理转发劫持,我将不胜感激。
谢谢你。
代理尝试运行帮助程序进行提示。在 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
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2375 次 |
| 最近记录: |