Skip to content
This repository was archived by the owner on May 25, 2025. It is now read-only.
This repository was archived by the owner on May 25, 2025. It is now read-only.

New header for id_rsa on macOs #263

@katoquro

Description

@katoquro

Environment info

groovy-ssh 2.10.1
openjdk version "11.0.3" 2019-04-16 LTS
groovy 2.5.7
jsch 0.1.55

Steps to reproduce

  1. generate new key (like in https://github.com/int128/docker-sshd : ssh-keygen -t rsa -N '' -C '' -f id_rsa )
  2. use generated key
  3. get exception java.lang.RuntimeException: java.lang.RuntimeException: com.jcraft.jsch.JSchException: invalid privatekey: [B@79f7005

According to this issue appears after ssh-keygen update because the header of the file was changed from -----BEGIN RSA PRIVATE KEY----- to -----BEGIN OPENSSH PRIVATE KEY-----

Workaround

with additional flag -m PEM key will be generated with old header.

Most of the people generate key using github guide or something like that and it leads to issues with groovy-ssh lib. So support of this ssh-keygen update is highly desirable.

I've generated keys from mac os with new version of ssh-keygen (ssh-keygen -t rsa -N '' -C '' -f id_rsa) keys.zip . You can use it to debug

Thank you!

p.s.
Is it possible to combine ssh related repos in one or make one multirepo with git-submodules? It's quite difficult to setup the whole env from scratch to debug the problem or run tests. And having all ssh-related issues in one repo also can be a bit convenient

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions