3 Replies Latest reply on Apr 8, 2009 3:02 AM by titomane

    ssh key pairs help!

    pauliew1978 Hot Shot

      Hi,

       

      I have 2 esx servers and want to stop the password prompt when using ssh between them so I can script ssh commands. I have created a key pair by typing:

       

      ssh-keygen -t rsa

       

      then copied the ida_rsa.pub to the authorized_keys file on the other esx server

       

      however it is still asking me for a password!

       

      thanks,

       

      Paul

        • 1. Re: ssh key pairs help!
          Jae Ellers Master

          I run this to prepare systems.  You'll need to run it once from each side:

           

          It may just be that you need to set specific permissions on the authorized_keys file

           

          #!/bin/sh

          \# sshput  $HOME/.ssh/authorized_keys && \

              chmod 0600 $HOME/.ssh/authorized_keys'

           

          if \[ $? -eq 0 ]

          then

              echo Public key installed on remote machine.

              echo You should now be able to connect with

              echo "    ssh $1"

              exit 0

          else

              echo Sorry, an error occurred!

              exit 1

          fi

          /code

          1 person found this helpful
          • 2. Re: ssh key pairs help!
            pauliew1978 Hot Shot

            Hi there,

             

            I find the answer....

             

            as well as creating key pairs and copying the id_rsa.pub to the other machines authorized_keys you also need to make sure that you edit the sshd_config file to allow rsa authentication AND (this is what got me!) you need to specify in the ssh client not to ask for a password!!!!) doh!!

            • 3. Re: ssh key pairs help!
              titomane Enthusiast

               

              you need to specify in the ssh client not to ask for a password!!!!) doh!!

               

               

              hi, 

               

               

              I know that there is quite a long time since this post was written but i'm in the same problematic here and I'm hard searching for a way to specify this in sshd_config and I can't find it...

               

               

               

               

               

              does anyone know how to disable asking pw when I configure my ESX / putty key pair. I found a doc talking about ESXi but nothing about ESX 3.5 and it's quite a different way of approach i guess.

               

               

               

               

               

              tomtom