1835228 Members
2281 Online
110078 Solutions
New Discussion

Re: Public Key and ssh

 
schifano
New Member

Public Key and ssh

Hello,
I'm working on hp-ux 11 with openssh A.03.10.002.
The authmethod password works.
But i try to use public key auth method and it doesn't work.
I have generate the keys and sent the public key on the remote machine.
the verbos ssh gives this lines :
...
debug3: Not a RSA1 key file /home/bull/.ssh/id_dsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: no key found
debug3: key_read: no space
debug3: key_read: no space
debug3: key_read: no space
debug3: key_read: no space
debug3: key_read: no space
debug3: key_read: no space
debug3: key_read: no space
debug3: key_read: no space
debug3: key_read: no space
debug3: key_read: no space
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: no key found
debug1: identity file /home/bull/.ssh/id_dsa type 2
...
debug3: remaining preferred: publickey,keyboard-interactive,password
debug3: authmethod_is_enabled gssapi
debug1: next auth method to try is gssapi
debug2: we did not send a packet, disable method
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: next auth method to try is publickey
debug1: try pubkey: /home/bull/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: authentications that can continue: external-keyx,gssapi,publickey,password,keyboard-interactive
debug1: try pubkey: /home/bull/.ssh/id_dsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
...
What have I to do ??
thnks for help
7 REPLIES 7
Jochen Heuer
Respected Contributor

Re: Public Key and ssh

Hello!

What does the file authorized_keys look alike? Does it have the correct syntax?

It should just start with the key length or the encryption type and the end of the line has the form of an email address.

Are there additional lines in it?
Well, yeah ... I suppose there's no point in getting greedy, is there?
Jochen Heuer
Respected Contributor

Re: Public Key and ssh

The syntax of authorized_keys is the same as in identity.pub. Usually you just have to do the following to create the correct entries:

$ ssh remote-host "cat ~/.ssh/identity.pub" >> ~/.ssh/authorized_keys
Well, yeah ... I suppose there's no point in getting greedy, is there?
schifano
New Member

Re: Public Key and ssh

yes i have :ssh-rsa ....... bull@bullbdd
I have watch the var/adm/syslog/syslog.log ont the remote machine.
In first, ther was ap problem of mode on this files.
I correct them.
Now i have the message : "Failed publickey for bull from 192.168.2.3"
Thanks
schifano
New Member

Re: Public Key and ssh

I try again to generate keys.
I verify the mode of the files and now it's working.
Thanks for our help and sorry for disturbing
Jochen Heuer
Respected Contributor

Re: Public Key and ssh

Hm, do you have a problem with hostname resolution? Is a reverse lookup from IP to name possible?

$ nslookup 192.168.2.3

What does

$ ssh -v remote-host

print? Are there other entries in ~/.ssh/authorized_keys?
Well, yeah ... I suppose there's no point in getting greedy, is there?
schifano
New Member

Re: Public Key and ssh

The nslookup works on the both machines
I clean teh authorized_keys and the authorized_keys2 and verify teh mode and the owner and now it works good
Thank you
Jochen Heuer
Respected Contributor

Re: Public Key and ssh

No problem! Good news that it's working ... These kind of problems did bite me for quite a while when I first got in contact with ssh :-)
Well, yeah ... I suppose there's no point in getting greedy, is there?