Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using rackspace cloud hosting. I have 2 servers behind a load balancer. Each server has an external IP and an internal IP. I want to setup a sync job that uses SSH to transfer files. I made an rsa key, and I can successfully SSH from server A into server B, using the external IP of server B, without being prompted for a password. If I try to do the same but use the internal IP, it prompts me for a password. I want to be able to use the key instead of the password. Why is this? Is there something special I have to do during key generation so it works for both IPs?

Any help is appreciated.

share|improve this question
    
It would help if you posted the commands you are using. You can supply ssh with a path to your keyfile: ssh -i ~/.ssh/id_rsa $IP –  Baarn Dec 14 '12 at 20:51
    
My key file is in the ~/.ssh/authorized_keys so I dont have to specify the key file. So when doing this ssh username@externalIP it logs right in, when doing this ssh username@internalIP it prompts for a password. –  Ian Dec 14 '12 at 20:58
    
authorized_keys are located on the server, you need to specify the private key you are using on the client. You can also create a config file in your .ssh folder. Check man ssh_config for syntax. –  Baarn Dec 14 '12 at 21:07

1 Answer 1

Need to add to the ~/.ssh/config file

Host internalIP
        IdentityFile ~/path/to/key
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.