Is there any way to verify why SSH key exchange between 2 servers is not working?
In Server A:
I did the following steps:
ssh-keygen –t rsa
cd /.ssh
cp id_rsa.pub authorized_keys
Then in Server B:
I created the .ssh
directory and uploaded the authorized_keys
from Server A
I tried logging in from Server A to Server B but the system is still prompting me to enter password.
I tried using this: On server(A) you connect via ssh user1@host? You might try ssh -o PreferredAuthentications=publickey user1@host but it show permission denied Permission denied (gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive).
Any advise on how to check what is wrong? Just additional info in Server A i am not using the root account.
Best Answer
Try
ssh -v
this should provide additional information about the authentication process.Just to confirm your steps: You created a keypair via ssh-keygen Then you uploaded the key at
.ssh/id_rsa.pub
to the server(B) and appended it to the.ssh/authorized_keys
for the user1.On server(A) you connect via
ssh user1@host
? You might tryssh -o PreferredAuthentications=publickey user1@host
And you could provide a special/different identityfile by
ssh -i ~/.ssh/serverB/id_rsa user1@host