This error occurs, when there are multiple known hosts and ssh command is unable to capture private key for specific host.
You have to specify host and private ssh key in ~/.ssh/config file as shown below:
You can tell your SSH client which keys to use for which host. Change your ~/.ssh/config file like this:
Host * IdentitiesOnly yes Host github.com github User your-user Hostname github.com RSAAuthentication yes Compression yes IdentityFile ~/.ssh/your-user.key Host domainname.com WhatEverNameYouWant User taimoor Hostname domainname.com RSAAuthentication yes Compression yes IdentityFile ~/.ssh/amazon_ssh_key_name.pem IdentitiesOnly yes Port 22 #In case of IP address Host 57.29.601.462 whateverNameYouWant User you-user-name-whateverYouWant Hostname 57.29.601.462 RSAAuthentication yes Compression yes IdentityFile ~/.ssh/ssh_private_key_file_name IdentitiesOnly yes Port 22