Mailing List Archive

Problems building host keys on some SPARCs
Hi,

I've compiled openssh 1.2.2 on Solaris 7/SPARC. On most hosts, things
are fine. I get EGD going, compile openssh, and I can then generate
hostkeys as described in the INSTALL file to get things running.

On a few hosts though, the keygen fails like this:

root@sylow:/source/USR_LOCAL/OFFICIAL/OPENSSH/ssh_client# ssh-keygen -b 1024 -f /etc/ssh/ssh_host_key -N ''
ksh: ssh-keygen: cannot execute

or fail like this:

root@sylow:/source/USR_LOCAL/OFFICIAL/OPENSSH/ssh_client# cat build_host_key
/usr/local/bin/ssh-keygen -b 1024 -f /etc/ssh/ssh_host_key -N ''
root@sylow:/source/USR_LOCAL/OFFICIAL/OPENSSH/ssh_client# sh build_host_key
/usr/local/bin/ssh-keygen: syntax error at line 1: `(' unexpected

These same invokations work fine on most of our other systems.

Info on the system above:
root@sylow:/source/USR_LOCAL/OFFICIAL/OPENSSH/ssh_client# uname -a
SunOS sylow 5.7 Generic_106541-07 sun4m sparc SUNW,SPARCstation-20

The only thing different I can see here is that the working systems
are Ultra class machines, and the non-working ones are SparcStations.

Any ideas?

Thanks,

-Robb
Re: Problems building host keys on some SPARCs [ In reply to ]
Hi,

MSCS Technician wrote:

> Hi,
>
> I've compiled openssh 1.2.2 on Solaris 7/SPARC. On most hosts, things
> are fine. I get EGD going, compile openssh, and I can then generate
> hostkeys as described in the INSTALL file to get things running.
>
> On a few hosts though, the keygen fails like this:
>
> root@sylow:/source/USR_LOCAL/OFFICIAL/OPENSSH/ssh_client# ssh-keygen -b 1024 -f /etc/ssh/ssh_host_key -N ''
> ksh: ssh-keygen: cannot execute
>
> or fail like this:
>

I suspect the above error could result from
the use of "ssh-keygen" as opposed to "./ssh-keygen".
Root should not have "." in its PATH setting. Looks that some of your hosts
do have "." in root PATH and others don't.

The next error message looks like one when I try to run
binaries meant for a different OS.
In your case, it is possible that you may have tried to run
binary, meant for Solaris 2.x ( SunOS 5.x ) on Ultra, on
SunOS 4.1.4 (or older?).
When you type the command,
the name of the executable file (mounted via NFS from Solaris host possibly)
to the shell on SunOS 4.1.4. Then, the shell figures out
it is not an object file since the newer ELF format is not known to it,
and tries to run this as shell script, and we get the error.
I have seen this message too many times to figure out
the architecture mimsmatch immediately :-)
(I used to have Sun, DEC and HP, but now stick to Sun, but we have
SunOS 4.1.4 still running as well as later SunOS 5.x)

If the above was the cause of your problem, you need to create a binary meant for
SunOS 4.1.4 . That you mention the non-working ones are SparcStation makes
me suspect this scenario.



> root@sylow:/source/USR_LOCAL/OFFICIAL/OPENSSH/ssh_client# cat build_host_key
> /usr/local/bin/ssh-keygen -b 1024 -f /etc/ssh/ssh_host_key -N ''
> root@sylow:/source/USR_LOCAL/OFFICIAL/OPENSSH/ssh_client# sh build_host_key
> /usr/local/bin/ssh-keygen: syntax error at line 1: `(' unexpected
>
> These same invokations work fine on most of our other systems.
>
> Info on the system above:
> root@sylow:/source/USR_LOCAL/OFFICIAL/OPENSSH/ssh_client# uname -a
> SunOS sylow 5.7 Generic_106541-07 sun4m sparc SUNW,SPARCstation-20
>
> The only thing different I can see here is that the working systems
> are Ultra class machines, and the non-working ones are SparcStations.
>
> Any ideas?
>
> Thanks,
>
> -Robb
Re: Problems building host keys on some SPARCs [ In reply to ]
Thanks for your response. Here's some new info.

>> root@sylow:/source/USR_LOCAL/OFFICIAL/OPENSSH/ssh_client# ssh-keygen -b 1024 -f /etc/ssh/ssh_host_key -N ''
>> ksh: ssh-keygen: cannot execute
> I suspect the above error could result from
> the use of "ssh-keygen" as opposed to "./ssh-keygen".
> Root should not have "." in its PATH setting. Looks that some of your hosts
> do have "." in root PATH and others don't.

This appears to have been the result of the same problem others were
having with scp. --with-default-path was needed to get that working
properly.

>> root@sylow:/source/USR_LOCAL/OFFICIAL/OPENSSH/ssh_client# sh build_host_key
>> /usr/local/bin/ssh-keygen: syntax error at line 1: `(' unexpected
> The next error message looks like one when I try to run
> binaries meant for a different OS.
> In your case, it is possible that you may have tried to run
> binary, meant for Solaris 2.x ( SunOS 5.x ) on Ultra, on
> SunOS 4.1.4 (or older?).

The only problem with this hypothesis is that both machines, the working
and the broken, run Solaris 7.

I am trying to use a single set of executables NFS mounted. Recompiling
it on the broken machines didn't help.

They do have different kernel architectures: the ultras and enterprise
servers that work are sun4u, the sparcstations that aren't working are sun4m.
This wasn't a problem with the commercial ssh-1.2.27 though.

As strange as it seems, is it possible there's something going on with
sun4m only?


Thanks,

-Robb
Re: Problems building host keys on some SPARCs [ In reply to ]
MSCS Technician wrote:

> Thanks for your response. Here's some new info.
>
> >> root@sylow:/source/USR_LOCAL/OFFICIAL/OPENSSH/ssh_client# ssh-keygen -b 1024 -f /etc/ssh/ssh_host_key -N ''
> >> ksh: ssh-keygen: cannot execute
> > I suspect the above error could result from
> > the use of "ssh-keygen" as opposed to "./ssh-keygen".
> > Root should not have "." in its PATH setting. Looks that some of your hosts
> > do have "." in root PATH and others don't.
>
> This appears to have been the result of the same problem others were
> having with scp. --with-default-path was needed to get that working
> properly.
>

Ok, I missed the possibility.

>
> >> root@sylow:/source/USR_LOCAL/OFFICIAL/OPENSSH/ssh_client# sh build_host_key
> >> /usr/local/bin/ssh-keygen: syntax error at line 1: `(' unexpected
> > The next error message looks like one when I try to run
> > binaries meant for a different OS.
> > In your case, it is possible that you may have tried to run
> > binary, meant for Solaris 2.x ( SunOS 5.x ) on Ultra, on
> > SunOS 4.1.4 (or older?).
>
> The only problem with this hypothesis is that both machines, the working
> and the broken, run Solaris 7.
>
> I am trying to use a single set of executables NFS mounted. Recompiling
> it on the broken machines didn't help.
>

I am surprised at this. I mean, in most of the cases I encountred it was possible to
run open-source programs by
- recompiling the program on the target architecture, and
- making sure that the command searched is the right one
(compiled for right-architecture, that is).

Hmm... Something else might be to blame.
Have you re-compiled the libraries, too?
(Zlib and openssh comes to mind for starters.)

>
> They do have different kernel architectures: the ultras and enterprise
> servers that work are sun4u, the sparcstations that aren't working are sun4m.
> This wasn't a problem with the commercial ssh-1.2.27 though.
>
> As strange as it seems, is it possible there's something going on with
> sun4m only?
>

I know that sun4m and sun4u are very different architecture, but
usually it is only noticeable at the OS kernel-level and
such architecture difference is more or less hidden behind system calls
(except for the fact that some instructions are missing in sun4m and
have to be emulated in software, and that the sun4m is sparc
V8 architecuture and sun4u is v9.)

I am at a loss to figure out the situation.

I wonder what the output of the following command is.

file /usr/local/bin/ssh-keygen

Also, you might want to try

sh -vx build_host_key

in order to trace where the error occurs.
Re: Problems building host keys on some SPARCs [ In reply to ]
Hey, I get to answer my own question! This is for the list archives
should anyone else encounter this problem like I did:

On Thu, Feb 17, 2000 at 11:02:44AM -0600, MSCS Technician wrote:
> I've compiled openssh 1.2.2 on Solaris 7/SPARC. On most hosts, things
> are fine. I get EGD going, compile openssh, and I can then generate
> hostkeys as described in the INSTALL file to get things running.
>
> On a few hosts though, the keygen fails like this:
>
> root@sylow:/source/USR_LOCAL/OFFICIAL/OPENSSH/ssh_client# ssh-keygen -b 1024 -f /etc/ssh/ssh_host_key -N ''
> ksh: ssh-keygen: cannot execute
>
> or fail like this:
>
> root@sylow:/source/USR_LOCAL/OFFICIAL/OPENSSH/ssh_client# cat build_host_key
> /usr/local/bin/ssh-keygen -b 1024 -f /etc/ssh/ssh_host_key -N ''
> root@sylow:/source/USR_LOCAL/OFFICIAL/OPENSSH/ssh_client# sh build_host_key
> /usr/local/bin/ssh-keygen: syntax error at line 1: `(' unexpected
>
> These same invokations work fine on most of our other systems.
>
> Info on the system above:
> root@sylow:/source/USR_LOCAL/OFFICIAL/OPENSSH/ssh_client# uname -a
> SunOS sylow 5.7 Generic_106541-07 sun4m sparc SUNW,SPARCstation-20
>
> The only thing different I can see here is that the working systems
> are Ultra class machines, and the non-working ones are SparcStations.

The problem here was the the SSL library wasn't being found. Clean compiles
on the affected machine brought this to light. I added the --with-ssl-dir=PATH
directive to OpenSSH's configure, but that was no good. I then rebuilt the
OpenSSL lib on one of the affected machines, then rebuilt OpenSSH and all is
now well.

Also for Solaris, I too can verify the /dev/random from the SUNWski package
works great, and is much faster than using the EGD entropy pool was.


-Robb



- Robert S. Dubinski, Comp. Systems Tech for MSCS Dept, Marquette University -
- Email me: tech@mscs.mu.edu Home page at: http://www.mscs.mu.edu/~tech -
- I can use GPG-encrypted email. My 1024-bit public key is at my website -
- GPG Key fingerprint = 6612 1A01 7A93 D79B 4C89 336E 592B DB76 61FB C156 -