SSH无密码登录

在这里提到的不仅仅是为了hadoop的配置,而是更一般的情况,你可以利用它登录在其他任意服务器的帐户,而免去每次输入密码的烦恼。由于当初记录时使用的英文,描述很简单,这里就不翻译了。


1. Connect to host via ssh without password

   i) Generate your private key and public key of your own client:
       $ ssh-keygen -t rsa

   Also, you can generate key with specifying the file storing the private/public key
       $ ssh-keygen -t rsa -f ~/.ssh/id_rsa.github -C "Key, e.g. user name"

   ii) Put the public key on the remote host, append the public key into the authorized_key file

2. Configure of ssh

   If you want to connect to many hosts with different profiles, e.g., different user names, without password. There will be many private key . You need to configure your ssh profiles in your client to tell ssh which . Here is an example:

   Host *.workdomain.com
       IdentityFile ~/.ssh/id_rsa.work
       User lee

   Host github.com
       IdentityFile ~/.ssh/id_rsa.github
       User git

你可能感兴趣的:(hadoop,配置,ssh)