SSH authentification with public key fails

2

I have my id_rsa.pub key under my /home/user/.ssh. I carefully copied that key and paste my key to respository Git account.

While trying to connect from my local system to my git respository, I got the following error:

warning: Authentication failed.
Disconnected; no more authentication methods available (No further 
authentication methods available.)

I removed SSH in system and re-enable and did again, but no luck. I have no idea what's happening with my SSH key. Can any one please tell me on this?

Note : I noticed in my home /home/user/.ssh && /home/user/.ssh2

palani

Posted 2010-06-09T10:30:34.607

Reputation: 141

Answers

1

read more about the whole public key thing 'here'. openssh wants the public-key in a file named ~/.ssh/authorized_keys. is that where you put it?

akira

Posted 2010-06-09T10:30:34.607

Reputation: 52 754

1@palani: since you answered my question in the other answer: then put the content of your id_rsa.pub file into the .ssh/authorized_keys file on the server. – akira – 2010-06-09T13:31:22.133

0

Hm, ssh on Ubuntu uses /home/user/.ssh for its configuration. Dunno where you got that .ssh2 from; the commercial SSH client from Tectia uses it, but you don't use that, do you? To be safe, move .ssh2 out of the way (rename it to .ssh2XXX, then rename it back when everything works).

To troubleshoot your problem, try connecting in debug mode:

ssh -vvv myuser@myhost 2>/tmp/ssh-debug-log

Then have a look at the logfile /tmp/ssh-debug-log to see what's wrong. If you can't figure it out, edit your question to include the logfile, then we'll see...

sleske

Posted 2010-06-09T10:30:34.607

Reputation: 19 887

debug: SshConnection/sshconn.c:1937/ssh_conn_destroy: Destroying SshConn object. debug: Ssh2Client/sshclient.c:1446/ssh_client_destroy_finalize: Destroying client completed. debug: SshAuthMethodClient/sshauthmethodc.c:162/ssh_client_authentication_uninitialize: Destroying authentication method array. – palani – 2010-06-09T11:29:29.037

Please put the log into your question, a comment is not appropriate (as I wrote...). – sleske – 2010-06-09T13:41:27.263

0

I don't know how you generated your keys, but mines were generated using PuTTY under Windows so I can remotely access my Linux box from work, and I copied/pasted the content of the public key into the ~/.ssh/authorized_keys file, and here it goes. One thing I always notice: The key file is made of one single line of text, no hard return in the file. I also kind of remember that in previous keys, the main issue I had was that the public key I was pasting from generated file had hard returns in it, and joining all lines together usually solved my problems.

JF

jfmessier

Posted 2010-06-09T10:30:34.607

Reputation: 2 530

i have don't have autorized_keys file on my location. instead of that i have ird_psa.pub key file – palani – 2010-06-09T12:09:10.280

1HAve you tried copying/pasting the public key from the file to the authorized_keys files, or even just tried to copy the file under a new name ? That may solve your problem – jfmessier – 2010-06-10T01:34:46.517

0

You might check the protections for the .ssh directory (should be 700) and the authorized_keys file (should be 644). Also, on the server, you can run sshd from the command line with the -d option to see some details of the authorization process, i.e.

sudo service sshd stop
/usr/sbin/sshd -d

rlduffy

Posted 2010-06-09T10:30:34.607

Reputation: 129