奇怪的是我用 keychain (http://www.gentoo.org/proj/en/keychain/) 一直都有问题,直接运行 keychain ~/.ssh/id_rsa 就不会提示密钥口令,只有一次提示了,还不知道是怎么弄的 :-S 。
如果登录主机时启用 ForwardAgent 的话,不需要用 keychain 直接就可以免输入口令登录其他设置了自己公钥的主机。
如果没有启用 ForwardAgent,或者运行在 screen 之内时,必须在每一个 shell 里面用下面的命令才可以免输入口令,只要当前的 shell 没有退出,一直就可以用

keychain \
&& source $HOME/.keychain/$(hostname -s)-sh \
&& ssh-add

Leave a Reply

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

This site uses Akismet to reduce spam. Learn how your comment data is processed.