Hi,
I am trying to connect from a Mac OS (Yosemite) to a Centos 6.6 through ssh.
I have two users that I connect to with two different pairs of keys (rsa).
For user1 I'm using ~/.ssh/
id_rsa and for user2 I'm using ~/.ssh/
id_user2
When I try to connect using user2's credentials, the user1's key takes precedence. I know this, because it prompts me for the mac os's user password to store the passphrase associated with the user1's private key and user2's private key doesn't have a passphrase.
I added both identities with the
ssh-add -K, but I receive this error: Too many authentication failures for user2. Which means, of course, that it tries to use user1's credentials.
I even tried to add only the user2's private key with ssh-add -K, but it still tries to connect with ~/.ssh/id_rsa
Of course, I would like the keys to be used automatically depending on the user I'd like to connect through.
/etc/ssh_config contains
Code:
IdentityFile ~/.ssh/id_trans
IdentityFile ~/.ssh/id_rsa
How can I get around this issue?
Thanks in advance