Linux ssh 多钥匙对的使用

2017-11-12  本文已影响34人  暴风鱼
多个ssh钥匙对

我有多个ssh钥匙对分别用于登陆不同的主机,怎么弄呢?

简单!

只要把他们都加到ssh-agent里就可以了!

    #Start the ssh-agent in the background.
    eval "$(ssh-agent -s)"

    #Add your SSH private key to the ssh-agent. 
    ssh-add ~/.ssh/id_rsa

参见:https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/

另外:

    # list all
    ssh-add -l
    
    # delete all from ssh-agent
    ssh-add -D
上一篇 下一篇

猜你喜欢

热点阅读