Operating System - HP-UX
1767311 Members
4593 Online
108961 Solutions
New Discussion юеВ

Re: sshd: server refused our key

 
SOLVED
Go to solution
Mark Zurl
Frequent Advisor

Re: sshd: server refused our key

The keys were generated using the puttygen command on my windows box. When you execute this in a "command prompt" window, a keys generator window pops up.

First you select the SSH2 keys preference button, then select the generate button, then you move the mouse around to generate randomness, then select the "load keys" button, which creates a public and private key pair.

After that, I ftp'd the public key from the windows box to my hpux machine, and placed it in /home/testuser/.ssh/public. I then moved (used "$mv") public to authorized_keys, checked ownership and permissions, etc.

Does this sound about right in terms of the sequence of steps?

Z
Tech Tip #167: Coffee and donuts make a meal.
RAC_1
Honored Contributor

Re: sshd: server refused our key

I was wondering about dsa or rsa keys?? Does it give that preference??
There is no substitute to HARDWORK
Mark Zurl
Frequent Advisor

Re: sshd: server refused our key

I selected the "SSH2 RSA" preference. I remember reading somewhere there was a difference between SSH2 and SSH-2 protocols, .. that in fact there was a difference, and that you had to be careful as the dash in SSH-2 was important .. just guessing here.

Thanks again,
Z
Tech Tip #167: Coffee and donuts make a meal.
RAC_1
Honored Contributor

Re: sshd: server refused our key

Do you have option of creating dsa keys?? IF yes, create and set them in authorized_keys.
There is no substitute to HARDWORK
Mark Zurl
Frequent Advisor

Re: sshd: server refused our key

Excellent suggestion .. I'll give DSA a try, as it is an option!

Let you know what happens in a little bit.
Z
Tech Tip #167: Coffee and donuts make a meal.
Mark Zurl
Frequent Advisor

Re: sshd: server refused our key

OK, this time I generated a key pair (public/private) and selected the "SSH2 DSA" preference. I know its "SSH2 DSA" because the comment in the public key verifies it.

Moved the new public key over to my HPUX server under /home/testuser/.ssh/authorized_keys and same thing ..

When I try to connect from my windows box, I get the hpux prompts as follows:

Using username "testuser".
Server refused our key
testuser@testsystem password:

I enter the password, and log in successfully .. no passphrase was ever supplied or asked for.

Z
Tech Tip #167: Coffee and donuts make a meal.
Tony Contratto
Respected Contributor
Solution

Re: sshd: server refused our key

Hello,

When using puttygen, the public key file that it saves is not in a format to use in the authorized_keys file. At the top of the puttygen window after you generate the key is a text box with the heading "Public key for pasting into OpenSSH authorized_keys file". That is what should be put into your authorized_keys file on the HP-UX box.

--
Tony
got root?
RAC_1
Honored Contributor

Re: sshd: server refused our key

Can you post the key that it generates? (dsa key) also on hp-ux, in sshd_config file do you have setting for preferred authentication??
There is no substitute to HARDWORK
Mark Zurl
Frequent Advisor

Re: sshd: server refused our key

Tony -

That nailed it !! Good call !!!
In fact, RAC and others hinted at this earlier as to the cut-n-paste. Just a stupid mistake on my part.

Well, its 4:30pm EST over here, so I'm headed out to HappyHour .. thanks everyone so much.

To recap, for those using PUTTY, when generating key pairs, make sure you cut-n-paste from the top pop-up puttygen window and double check your paste.

Z


Tech Tip #167: Coffee and donuts make a meal.
Mark Zurl
Frequent Advisor

Re: sshd: server refused our key

Original Problem:
sshd does not prompt for passphrase, and generates "server refused our key" error while trying to log in.

Resolution:
The authorized_keys file did not contain the proper key. The puttygen key pair generator was used incorrectly. The authorized_keys file key should have been cut-n-paste'd from the top screen in the generator .. instead, the public key was used incorrectly.
Tech Tip #167: Coffee and donuts make a meal.