zopencommunity / opensshport

A suite of secure networking utilities
Apache License 2.0
1 stars 0 forks source link

Load key - error in libcrypto #10

Closed depemco closed 4 months ago

depemco commented 6 months ago

When using ssh from this port, I get an error when I want to connect to a machine with my already existing ssh-key: error in libcrypto.

When I create a new ssh-key with the ssh-keygen from this port, it does work. But it would be a pain if everyone that uses the current ssh that's in IBM's /bin/ssh, has to create a new ssh-key and implement this into their scripting.

I did find a workaround for using the current ssh-key: adding a newline at the end of the private key file.

BEFORE:

-----BEGIN OPENSSH PRIVATE KEY-----
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==
-----END OPENSSH PRIVATE KEY-----

AFTER:

-----BEGIN OPENSSH PRIVATE KEY-----
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==
-----END OPENSSH PRIVATE KEY-----

Why does it work with the current /bin/ssh and not with the ssh from this port?

When I create a new ssh-key with the ssh-keygen from this port, I don't see an extra newline at the end in the private key. But that is working well...

It would be a pain if everyone has to create a new ssh-key, or has to manually add a newline to the end of the private key. Is there something you could change in this port to make it compatible with existing private keys?

depemco commented 4 months ago

I see in the latest version you gave me the option to use the default /bin/ssh:

Openssh has been installed with the prefix "zot" under bin/zotssh to avoid collision with z/OS /bin/ssh.
If you prefer to use OpenSSH as ssh, source zopen-config with the option --override-zos-tools.
Or add $ZOPEN_ROOTFS/usr/local/altbin to your $PATH.

That's great! No problems with ssh, and still the abilty to enjoy the ssh-copy-id and the other options of the Z Open Tools's ssh!

Thanks!

IgorTodorovskiIBM commented 4 months ago

Great, FYI, we've done this for a few more tools - https://github.com/orgs/ZOSOpenTools/discussions/825.