Reputation: 107
Does anyone know if there are restrictions with PHPSecLib when using a password with a private key? Right now, it seems that if we use a private key password that contains the "#" character, login to sftp servers fail. If we use another keypair with the same password slighly modified to remove the # character from the private key, the login will succeed.
As far as we can tell we're not doing something silly in our code. The only difference between the keys that work with PHPSecLib and the ones that don't is that single character in the private key password. We've also double-checked to make sure that both keypairs work with a standard SSH client.
So, looking to see if this is a known issue - could not find anything specific about it on the GITHUB issues list.
(We haven't tried it yet with any other special character - just using the # char for now.)
Thanks in advance for any information you might have.
Upvotes: 0
Views: 362
Reputation: 107
Following up on this - the problem is not the phpseclib library. It turns out that if you use WSL to generate a key pair with a password, it doesn't generate a properly encrypted keypair for some reason. Based on how we were generating the two key pairs we were using for testing (we were using different machines), it made it seem that the special chars were an issue. But it was just WSL generating incompatible key pairs if you used a password...
Upvotes: 1