Ssh-Agent
上回书说到通道服务器的问题。在 /etc/csh.cshrc 中添加下列内容,可令系统同时启动 gpg-agent 和 ssh-agent:
1
2
3
4
5
6
7
| setenv SSH_AUTH_SOCK /dev/null/nonexistent
if ("${TERM}" != "su") then
[ -e ~/.gpg-agent.csh ] && source ~/.gpg-agent.csh >& /dev/null
echo UPDATESTARTUPTTY | /usr/local/bin/gpg-connect-agent >& /dev/null || /usr/local/bin/gpg-agent --daemon --ignore-cache-for-signing >& ~/.gpg-agent.csh && source ~/.gpg-agent.csh >& /dev/null
[ -e ~/.ssh-agent.csh ] && source ~/.ssh-agent.csh >& /dev/null
[ -e ${SSH_AUTH_SOCK} ] || ssh-agent -c -t 20m >& ~/.ssh-agent.csh && source ~/.ssh-agent.csh >& /dev/null
endif
|
启动 gpg-agent 的作用是在一段时间内不用重新输入 gpg 的密码。
阅读全文…(
本文约 412 字,阅读大致需要 1 分钟
)之前 @quakelee 提的一个问题(通道上登录第二台机器作为跳板登录第三台机器,但不把ssh私钥传到中间那台机器上)。如果shell是csh,在 ~/.cshrc 中加入:
source ~/auth.csh
[ -e ${SSH_AUTH_SOCK} ] || ssh-agent -t 15m -c > ~/auth.csh && source ~/auth.csh
然后所有的 csh 就可以使用同一个ssh agent了。
阅读全文…(
本文约 294 字,阅读大致需要 1 分钟
)