3 Replies Latest reply on Aug 23, 2012 2:36 PM by Dude!

    ssh autologin


      I try to configure login without password beetwhen two server.
      Both servers are Linux Oracle 6.3

      on racnode1:
      /usr/bin/ssh-keygen -t rsa
      cd ~/.ssh
      cat id_rsa.pub >> authorized_keys
      scp authorized_keys2 racnode2:~/.ssh/

      on racnode2:
      ssh racnode1 date
      @racnode1's password:

      Please help!
        • 1. Re: ssh autologin
          The following should work. Remember to login as the user for whom this is for.

          ssh oracle@node1
          mkdir -p ~/.ssh
          chmod 700 ~/.ssh
          rm -f ~/.ssh/id_dsa
          ssh-keygen -t dsa -N "" -f ~/.ssh/id_dsa
          KEY=`cat ~/.ssh/id_dsa.pub`
          ssh oracle@node2 "mkdir -p .ssh; chmod 700 .ssh"
          ssh oracle@node2 "echo "$KEY" >> .ssh/authorized_keys; chmod 644 .ssh/authorized_keys"

          Then to the same from the other host2 to host1. I would recommend to use DSA encryption to make it work for SCP and SFTP too.

          For more info, see 3) Set up SSH user equivalence for SCP and SFTP
          Thread: OL5 Howto: Installing and using cURL with support for SCP and SFTP
          OL5 Howto: Installing and using cURL with support for SCP and SFTP
          1 person found this helpful
          • 2. Re: ssh autologin
            I do not know why, but it worked after I run:

            Edited by: a.aurel on 23.08.2012 14:04
            • 3. Re: ssh autologin
              Sounds like you have fetched the public key from the remote host rather than sending your public key to the remote host.

              Using ssh-add you are experiencing the desired affect, but are probably using different methods:

              The ssh-add utility is used in connection with the ssh-agent. An SSH agent is a program that responds to authentication-related queries from SSH clients. It can be used to save your passphrase so that you do not have to enter it each time you initiate an ssh or scp connection. If I remember it works similar to a "keychain" which will last for your current session and you will have to use the initial ssh-add followed by the password each time.