1829101 Members
2526 Online
109986 Solutions
New Discussion

openssh configuration

 
SOLVED
Go to solution
Michael Tully
Honored Contributor

openssh configuration

Hi,

I am trying to configure 'openssh' version 2.5.1p1 on a HP-UX 11 box. The version I have was the binary downloaded from the HP porting centre.
I have a few problems in trying to get the
package to work.
I can't get the 'sshd' daemon to start
The messages it gives me are that the host keys are bad even though I had already created them using the 'ssh-keygen' command.
The syntax of the 'ssh-keygen' commands used was
# ./ssh-keygen -t rsa1 -f /opt/openssh2/etc/ssh_host_key -N "password"
# ./ssh-keygen -t rsa -f /opt/openssh2/etc/ssh_rsa_key -N "password1"
# ./ssh-keygen -t dsa -f /opt/openssh2/etc/ssh_dsa_key -N "password2"

When I try to start the 'sshd' daemon I get the following error messages.

# ./sshd &
[1] 8488
# error: Could not load host key: /opt/openssh2/etc/ssh_host_key: Bad file number
error: Could not load host key: /opt/openssh2/etc/ssh_host_dsa_key: Bad file number
error: Could not load host key: /opt/openssh2/etc/ssh_host_rsa_key: Bad file number
Disabling protocol version 1. Could not load host key
Disabling protocol version 2. Could not load host key
sshd: no hostkeys available -- exiting.

Have I got something incorrect in the way that I am doing this or I have some configuration issue??

Please help before I get a rope and hang it over the nearest tree..

-Michael
Anyone for a Mutiny ?
6 REPLIES 6
Sridhar Bhaskarla
Honored Contributor

Re: openssh configuration

Michael,

When you ran ssh-keygen did you have
/opt/openssh2/etc/ssh_host_key.pub file created?.

Else, you can do one thing. Do not specify the type just do

./ssh-keygen -b 1024 -f /opt/openssh2/etc/ssh_host_key -N "password"

You sshd should be able to read this key.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Michael Tully
Honored Contributor

Re: openssh configuration

Hi Sri,

Yes there was a 'ssh_host_key.pub' file.

I ran your suggested method and then tried
to start the daemon '/opt/openssh2/sbin/sshd &'
This produced a similar error message to before.
# /opt/openssh2/sbin/sshd &
[2] 9420
# error: Could not load host key: /opt/openssh2/etc/ssh_host_key: Bad file number
/opt/openssh2/etc/ssh_host_dsa_key: No such file or directory
error: Could not load host key: /opt/openssh2/etc/ssh_host_dsa_key: No such file or directory
/opt/openssh2/etc/ssh_host_rsa_key: No such file or directory
error: Could not load host key: /opt/openssh2/etc/ssh_host_rsa_key: No such file or directory
Disabling protocol version 1. Could not load host key
Disabling protocol version 2. Could not load host key
sshd: no hostkeys available -- exiting.

Are there any changes required for the config files ssh_config & sshd_config prior to starting the daemon?

Michael
Anyone for a Mutiny ?
Sridhar Bhaskarla
Honored Contributor

Re: openssh configuration

Micheal,

Please ignore that message. No use. I tried to reproduce the problem and I could.. I think the keys I got here were generated during the make install program. sshd doesn't seem to like the keys generated by ssh-keygen command.
I have a copy of my old keys. sshd starts up with them fine but not with the ones that I generate.

Well, we don't really have to change the configuration as sshd is correctly identifying the path. It's a matter of compatibility. We may have to dig out the make/install programs and see how they are doing inside. I am trying to do it now. My installation is pretty old so I am kind of struggling to get to my previously saved code.

I am attaching my keys. See if you can bring up your sshd with them meanwhile to confirm our argument.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Michael Tully
Honored Contributor

Re: openssh configuration

Hi Sri,

We have to try this tomorrow, I have to go to another site and fix a dead system.

Regards
Michael
Anyone for a Mutiny ?
Sridhar Bhaskarla
Honored Contributor
Solution

Re: openssh configuration

Michael,

I think I got the clue.I knew I did it before but could never remember. Don't specify any password while generating host keys.

# ./ssh-keygen -t rsa1 -f /opt/openssh2/etc/ssh_host_key -N ""
# ./ssh-keygen -t rsa -f /opt/openssh2/etc/ssh_rsa_key -N ""
# ./ssh-keygen -t dsa -f /opt/openssh2/etc/ssh_dsa_key -N ""

Now try starting sshd.

#./sshd &

It should start. I have gotten rid of the problem this way. Enjoy.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Sridhar Bhaskarla
Honored Contributor

Re: openssh configuration

Oops. One more thing I forgot to mention. Check your rsa and dsa lines. You are supposed to specify ssh_host_rsa_key and ssh_host_dsa_key instead ssh_rsa_key and ssh_dsa_key.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try