note 49976 modified in function.ssh2-shell by pollita
| From: | pollita@php.net | Date: | Tue, 22 Feb 2005 06:38:42 +0000 |
| Subject: | note 49976 modified in function.ssh2-shell by pollita | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-85354@lists.php.net to get a copy of this message | ||
Using ssh_exec, one could execute only one command at a time. However, ssh_shell, offers greater
flexibility.
Here is an example:
<?php
$con=ssh2_connect('192.168.0.1', 22);
ssh2_auth_password($con, "user", "password");
$shell=ssh2_shell($con, 'xterm');
fwrite( $shell, "cd /dir_one\n");
fwrite( $shell, "ls -la\n");
fwrite( $shell, "cd /dir_two\n");
fwrite( $shell, "ls -la\n");
?>
Thanks Sara for your implementation and your help !
--was--
Using ssh_exec, one could execute only one command at a time. However, ssh_shell, offers greater
flexibility, Thanks to Sara !.
Here is an example:
<?php
$con=ssh2_connect('192.168.0.1', 22);
ssh2_auth_password('$con, "user", "password");
$shell=ssh2_shell($con, 'xterm');
fwrite( $shell, "cd /dir_one");
fwrite( $shell, "ls -la ");
fwrite( $shell, "cd /dir_two");
fwrite( $shell, "ls -la ");
?>
Thanks Sara for your implementation and your help !
http://php.net/manual/en/function.ssh2-shell.php