Comments (5)
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.
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.
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.
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.
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)
- Compatibility with PHP 8.1 windows dll HOT 1
- ssh2_auth_password Password parameter does not work as expected HOT 4
- ssh2_auth_pubkey_file caused "segmentation fault" when enable xdebug HOT 1
- ssh2_exec execution stops after 32kb of data
- PHP 7.4 Comatibility HOT 2
- Cannot specify timeout HOT 1
- ssh2 php8.2 for windows (.dll file) HOT 1
- Version 1.4 missing on PECL HOT 3
- ssh2_scp_send() truncates files, incomplete file saved on remote server
- ssh2_exec: retrieve the command exit code HOT 1
- SSH2 fails after upgrading to PHP8.2 and Debian Bookworm - ssh2_auth_pubkey_file(): Authentication failed HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pecl-networking-ssh2.