Saturday, April 7, 2012

configure passphraseless SSH login among CentOS servers

  1. wget http://pkgs.repoforge.org/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
  2. wget http://apt.sw.be/RPM-GPG-KEY.dag.txt
  3. rpm -K rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
  4. rpm -ivh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
  5. vi /etc/yum.repos.d/rpmforge.repo
    add “priority=3″ or other right priority number after “enabled = 1″
  6. yum repolist
  7. yum install keychain
  8. ssh-keygen -t dsa
  9. chmod 755 .ssh
  10. scp ~/.ssh/id_dsa.pub user@remotehost:.ssh/authorized_keys
    Or:
    cat ~/.ssh/id_dsa.pub | ssh hadoopuser@remotehost "cat - >> ~/.ssh/authorized_keys"
  11. chmod 600 ~/.ssh/authorized_keys
  12. vi .bash_profile
    add following commands:
    /usr/bin/keychain -q $HOME/.ssh/id_dsa
    source $HOME/.keychain/$HOSTNAME-sh
  13. Logout and login. password for key files is asked and will be asked at first time login only. or run command source .bash_profile 
  14. run ssh among servers without being asked for password
http://www.cyberciti.biz/faq/ssh-password-less-login-with-dsa-publickey-authentication/ http://www.ehowstuff.com/how-to-configure-rpmforge-repository-on-centos-6-3/ http://www.cyberciti.biz/faq/ssh-passwordless-login-with-keychain-for-scripts/

No comments:

Post a Comment