|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59012 Unable to re-use an SSH connection
Submitted: 2009-12-29 10:45 UTC Modified: 2012-06-15 12:43 UTC
Avg. Score:4.0 ± 0.8
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:1 (33.3%)
From: samuel dot roze at gmail dot com Assigned:
Status: Duplicate Package: ssh2 (PECL)
PHP Version: 5_3 SVN-2009-12-29 (dev) OS: Debian 5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: samuel dot roze at gmail dot com
New email:
PHP Version: OS:


 [2009-12-29 10:45 UTC] samuel dot roze at gmail dot com
When an SSH2 Session (ssh2_connect result) is used with ssh2_shell, it cannot be used with ssh2_exec or any scp file transfert.

Why ?

Reproduce code:
$ssh = ssh2_connect('localhost', 22);
$co = ssh2_auth_password($ssh, 'root', 'UXrFzhCyZkt7999dX3mHB2');

$shell = ssh2_shell($ssh, 'vanilla', null, 90, 50, SSH2_TERM_UNIT_CHARS);

var_dump(fgets($shell, 1024));
var_dump(fgets($shell, 1024));

$exec = ssh2_exec($ssh, 'pwd');

Expected result:
string(X) "[...]"
string(X) "[...]"
resource(X) of type (stream)

Actual result:
string(X) "[...]"
string(X) "[...]"
Warning: ssh2_exec(): Unable to request a channel from remote host in /home/d-sites/myonlinessh/tests/ssh-rps-reuse.php


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-15 12:43 UTC]
-Status: Open +Status: Duplicate
 [2012-06-15 12:43 UTC]
Duplicate of bug #58893
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Apr 11 18:01:23 2021 UTC