每次登录服务器都要执行以下操作,添加ssh密钥
ssh-agent bash
ssh-add ~/.ssh/id_rsa
很烦,安装keychain,每次登录自动添加,一劳永逸!
Linux
安装keychain
wget [ftp://fr2.rpmfind.net/linux/mageia/distrib/cauldron/i586/media/core/release/keychain-2.8.3-1.mga6.noarch.rpm](ftp://fr2.rpmfind.net/linux/mageia/distrib/cauldron/i586/media/core/release/keychain-2.8.3-1.mga6.noarch.rpm)
sudo yum install -y keychain-2.8.3-1.mga6.noarch.rpm
在~/.bashrc文件加入:
eval 'keychain --eval ~/.ssh/id_rsa'
Mac
安装keychain
brew install keychain
ssh-add -K ~/.ssh/<private_key_file> //不可行,待继续研究
网友评论