Operating System - Linux
1831242 Members
2897 Online
110021 Solutions
New Discussion

Re: SSH hostbased authentication

 
Matthias Bayer
Advisor

SSH hostbased authentication

Hi,

can somebody point me to a good documentation on how to setup ssh hostbased authentication from linux to linux as well as from linux to HP-UX ?

i have read many different documents but none of them has had a working solution for me.
i am always asked for a password when connecting from system A to system B, i have copied over my ssh_host_key.pub and configured the daemons right (hopefully) but without success ....
on linux i use OpenSSH3.8p1-33 and on HPUX i use HP-UX Secure Shell 3.81.004

any help very welcome..

Matthias
3 REPLIES 3
Denver Osborn
Honored Contributor

Re: SSH hostbased authentication

Did you take the contents of system A's ssh_host_key.pub and put them in system B's ~/.ssh/authorized_keys file? If not, then it won't use the public key auth... and from your question, I assume that this is what you're trying to setup.

I'm pretty sure someone on the ITRC Forums (hpux) had a mini how-to for what you're trying to setup. I'll post the link when I come across it again.

Until then, you need to take host A's ssh key and "cat ssh_key.pub >> ~/.ssh/authorized_keys" on host B. Then when you ssh from host A to host B it should work... unless the pub key on host isn't in a standard location or name. In that case when you ssh from host A you would use "-i /path/your_ssh_key" option. Check out the ssh man page for details.

For troubleshooting on the client, you can also add "-vvv" option to your ssh syntax.

Hope this helps (or atleast makes some sense),
-denver
Denver Osborn
Honored Contributor

Re: SSH hostbased authentication

Found the thread I was thinking about. Chris Vail posted and attached an easy to follow how-to.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=184587

hope this helps,
-denver
Matthias Bayer
Advisor

Re: SSH hostbased authentication

Hi Denver,

thanks for all this information.
maybe i have just misunderstood the whole 'hostbased' thing ...
everything you described works for me as well but this requires an already existing key for user root on system B. after a fresh install there is no key for user root available but there is a ssh_host_key.pub already available and i thought copying this key (istead of craeting an key for user root) to /etc/ssh/authorized_keys would work - but it doesn't.

so am i wrong or is this user-based authentication when i use the keys from both root users ? i thought using the host_key files is host based authentication ... correct me if i am wrong but i still can't make it work with the host_key.. the solution with the keys from the root users works fine.

thanks for helping.

Matthias