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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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
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

Pull Requests

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: Sun Dec 22 06:01:30 2024 UTC