How to install keychain manager for ssh-agent on CentOS 6/7

h‮sptt‬://www.lautturi.com
How to install keychain manager for ssh-agent on CentOS 6/7

To install keychain, a manager for the ssh-agent on a CentOS 6 or CentOS 7 system, you can use the following steps:

  1. Install the rpmforge repository:
sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

This will install the rpmforge repository, which contains the keychain package.

  1. Install keychain:
sudo yum install keychain

This will install keychain and its dependencies.

  1. Set up keychain:
  • Add the following lines to your ~/.bash_profile file:
eval $(keychain --eval --agents ssh id_rsa)
source ~/.keychain/$HOSTNAME-sh

This will set up keychain to start automatically when you log in, and to use your ssh key with ssh-agent.

  1. Reload the bash_profile:
source ~/.bash_profile

This will apply the changes to the bash_profile file.

  1. Add your ssh key:
ssh-add

This will add your ssh key to the ssh-agent.

Created Time:2017-10-28 21:39:04  Author:lautturi