FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.

» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

LinkBack Thread Tools
Old 11-23-2007, 04:33 PM
Tobias Nissen
Default Connecting to ssh server from php script

Hi Misko!

Misko wrote:
> I am able to connect to telnet server from php script
> to log in, send some commands and log out automaticly.
> Now I do need to do this with ssh server.
> Is this possible? Please send me info how to do it
> or where can I find it on the web.

Expect[0] does exactly that.


[0] http://expect.nist.gov/
Old 11-24-2007, 11:51 AM
Default Connecting to ssh server from php script

On Fri, Nov 23, 2007 at 06:33:32PM +0100, Tobias Nissen wrote:
> Expect[0] does exactly that.

expect is not what am I looking for.
I was not very clear in my original post, sorry.

I have web page on server with php running with safe_mode on.
It has fsockopen() enabled.
With this I can connect to telnet server (or smtp, pop3 ...)
and do what I need to do (write command, read response).
Now I want to connect to ssh server from php script that
is on webserver with safe_mode (no system() call).
I was hoping to do it with something like
$fp = fsockoen("ssl://ssh.example.com", 22, $errno, $errstr, 30);
but it does not open the socket.

My friend bring to my attention that there is module available for
php that has binding to libssh2 library. Module has function
Unfortunately web server I have my pages on does not have this module
enabled and they do not plan to change that. (Also I was not able
to find libssh2 library and its php binding in my etch's DVDs).

Now I have two questions:
a) Is it possible to connect and comunicate with ssh server
with fsockopen()?
b) Does anybody know of some free web hosting service that
has ssh2_exec() function available?


To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Thread Tools

All times are GMT. The time now is 10:45 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org