php.net |  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
Votes:3
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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
6 + 39 = ?
Subscribe to this entry?

 
 [2009-12-29 10:45 UTC] samuel dot roze at gmail dot com
Description:
------------
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:
---------------
<?php
$ssh = ssh2_connect('localhost', 22);
$co = ssh2_auth_password($ssh, 'root', 'UXrFzhCyZkt7999dX3mHB2');
var_dump($co);

$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');
var_dump($exec);
?>

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

Actual result:
--------------
bool(true)
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
bool(false)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-15 12:43 UTC] langemeijer@php.net
-Status: Open +Status: Duplicate
 [2012-06-15 12:43 UTC] langemeijer@php.net
Duplicate of bug #58893
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 23:01:29 2024 UTC