ssh publickey authentication
I have followed all the stepts described here
http://sial.org/howto/openssh/publickey-auth/ up until "Ket Access Limits" and when I try to enter the server from the client I get this Code:
stef@stefan:~$ ssh -o PreferredAuthentications=publickey spx2@firepower |
On the server-side, log in as the user and do:
Code:
cd ~/.ssh Code:
cat authorized_keys | grep --file=id_rsa.pub Code:
$ ssh -i myid_rsa.prv -o PreferredAuthentications=publickey spx2@firepower |
I have tried what you wrote here and I still get the same error
|
Try verbose output in the ssh command and see what is going on,
Quote:
|
check the permissions of the key on the client. might be that one that has permissions that makes it unreadable. anyway, I'm pretty sure that if you use SSH2 (which you should!) the file on the server is named ~/.ssh/authorized_keys2
|
@digen
the output of verbose ssh Code:
OpenSSH_4.6p1 Debian-5, OpenSSL 0.9.8e 23 Feb 2007 |
Quote:
http://sial.org/howto/openssh/#s6 |
Are you using a passworded key? Are you sure that you've got the password right? Try using a key with no password, or a simple password first, just to test the system, and then replace it once you know everything works.
Also, try tightening up the permissions of the .ssh folder: Code:
chmod 600 -R ~/.ssh |
ok,I've put appropriate permissions,
I've tried again,and I've got some better debug output from verbose switch output. here are those messages: Code:
debug1: match: OpenSSH_4.3p2 Debian-9 pat OpenSSH* |
I've deleted all .ssh on both machines and started all over.
suppose the machines are called A and B. I've done this A/.ssh/id_rsa.pub -> B/.ssh/authorized_keys B/.ssh/id_rsa.pub -> A/.ssh/authorized_keys Now I can do ssh from A->B but not B->A. Was the first one enough to be able to ssh both ways with public keys or was thesecond one needed ? |
In order to ssh from A to B, B needs to have the contents of A's 'id_rsa.pub' file in its authorized_keys file.
Similarly, in order to ssh from B to A, A needs the contents of B's 'id_rsa.pub' file in its authorized_keys file. So, if you want to go both ways, then yes, you do need to do both. Is it working now then? |
I can do A->B but not B->A.
I have checked error logs and -v -o output of ssh but I can't identify the problem |
All times are GMT -5. The time now is 08:16 AM. |