SSH login without password This document tells you (hereafter referred as user a) how to ssh from a linux host A (hereafter referred to as host A) into a another linux host B (hereafter referred to as host B) without requiring a password. To begin with, check in the home directory of user a, ~/.ssh/, whether the 'public key' for user a in host A, named id_rsa.pub, exist. If not, generate it by issuing the command line ssh-keygen -t rsa If 'ssh-keygen -t rsa' has ever been executed by user a in an earlier time, in the directory ~/.ssh of user a you will find a pair if authentication keys, named respectively as 'id_rsa.pub' and 'id_rsa'. If you issue 'ssh-keygen -t rsa' again the public key will be overwritten by a newly generated one. This may not be a good thing to do. The advice is to avoid overwritting the existing public key. Generate it only if there isn't any in ~/.ssh in the first place. In order to access host B from host A with username a, the authentication key id_rsa.pub of user a in host A has to be appended to host B's ~/.ssh/authorized_keys. To allows user a to ssh from host A into host B without a password, log in to host B as user a. In the directory ~/.ssh/ of user a in Host B, check whether a file named authorized_keys exist. Create one if there is none. Copy all the content of id_rsa.pub in ~/.ssh of user a in Host A into ~/.ssh/authorized_keys of user a in host B. If ~/.ssh/authorized_keys in host B for user a already existed, append to it the content of id_rsa.pub of user a. Two very useful command lines are provided below. Use them to remotely append the ~/.ssh/id_rsa.pub key for user a in host A into the .ssh/authorized_keys of user a in host B. 1. ssh user@XXX mkdir -p .ssh This will create a .ssh folder in the home directory of user in host with IP address XXX. The switch -p assure that the .ssh directory will not be created it it already exist, and no warning statement will appear. 2. cat ~/.ssh/id_rsa.pub | ssh user@XXX 'cat >> .ssh/authorized_keys' Issue the command line 2 as user in host A. As a result the content of the public key id_rsa.pub of user in host A will be appended to ~/.ssh/authorized_keys for user in host XXX. 3. ssh XXX ssh-keygen -t rsa Issuing the command line 3 as user form host A will remotely generate a id_rsa.pub key for user in ~/.ssh/ in host B. Use this command line only if you are sure that the public key for user in host B has not been generated, or else the existing publbic key will be replaced by the new one, which may cause undesired consequence.