Giter Club home page Giter Club logo

Comments (5)

Grundik avatar Grundik commented on June 12, 2024 1

This PHP module just uses libssh2, not limiting hostkey method. But libssh2 is not the part of openssh, its completely different library, so its compatibility is not that good, especially in older versions.

Modern versions of libssh2 are supporting ECDSA and ED25519, but it depends on distro, which version are provided there. For example, debian bullseye has quite old version, and there be problems.

But all of that is not a problem of PHP ssh2 module, it all roots in libssh2. Which is rarely updated, leading to quite a lag of feature implementation for end user. For example they skipped rsa-sha2 method completely, which should have been implemented ~10 years ago.

from pecl-networking-ssh2.

langemeijer avatar langemeijer commented on June 12, 2024

Did you verify that ssh2_connect() is not working with servers without dss or rsa?

glancing over the php_ssh2_session_connect() does not reveal anything specific to either ssh-rsa or ssh-dss.

At the time the documentation was written, both hostkey methods probably were the only two. As the ssh2 extension is only a thin wrapper over libssh2, the supported hostkey methods probably are defined by what your libssh2 capabilities. ed25519 and ECDH is support has been in libssh2 since 2018-ish, so any recent version could very well work.

Could you check? In that case this is a documentation issue.

from pecl-networking-ssh2.

Grundik avatar Grundik commented on June 12, 2024

I've done some research, and obtained following data:

  • in debian unstable ssh2_connect accepts hostkey type ssh-ed25519, and even uses that method by default, without explicit overriding;
  • in debian stable ssh2_connect does not accepts any hostkey types, except specified in documentation (ssh-rsa, ssh-dsa), regardless of version of PHP (but ssh itself uses such keys without any problems);
  • in no cases I was able to use rsa-sha2-256/rsa-sha2-512 hostkey types, nor by explicitly specifying, nor automatically.

So it seems like issue is both the code and documentation, since ssh2_connect sometimes can use extra hostkey types, but its strangely unreliable. And it seems like there are no connection with libssh2 binary itself, since in any stated cases, it was able to support any mentioned hostkey types.

Maybe its a compilation options, like some #defines?..

from pecl-networking-ssh2.

Grundik avatar Grundik commented on June 12, 2024

Oh, surprisingly for me, but libssh2.so is not part of openssh package, and its completely independent.

So it seems like libssh2 issue after all: version from in debian unstable (1.10) accepts ed25519, but version from debian stable (1.9) does not. And both of them does not accepts sha2.

from pecl-networking-ssh2.

rfay avatar rfay commented on June 12, 2024

I'd be interested to know whether you tracked this to a particular libssh2 problem? I'd also be interested in why it was "closed as completed".

from pecl-networking-ssh2.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.