PHPSECLIB ssh2 \\n not working

2019-09-15 10:21发布

问题:

So i am removing into a old server running a old IBM OS and GUI when i go to log in I run command:

$ssh->write("username\n");
$ssh->write("Passw0rd");

However it just outputs

Type Your ID    username
Type your Password 

Its as if the \n never worked.

回答1:

The system is in the most abstract way is a old windows machine. \n works on modern machines but the older windows use \r

Using \r Resolved the issue.



标签: ssh phpseclib