php and telnet merging
Moderator: General Moderators
-
depaolo2001
- Forum Newbie
- Posts: 2
- Joined: Thu Aug 04, 2005 3:38 am
php and telnet merging
plz help... any1 out der... nid help regarding using telnet functions in a php program... for example... changing a directory,creating files, ejecting and shutting down by use of a php program... thnx... (.!_!.)
All you need is http://www.php.net/fsockopen and then read/write from that socket..
Btw, there is also a SSH2 extension..
Btw, there is also a SSH2 extension..
-
depaolo2001
- Forum Newbie
- Posts: 2
- Joined: Thu Aug 04, 2005 3:38 am
thnx 4 d reply... cre 2 help some more?...
i wud like to thank you 4 your reply sadly am not adept in using PHP yet and i wouldnt be able to fully understand and use SSH in such a short period... if you would be kind enough to provide a sample program that incorporates the use of SSH in shutting down the PC... as of now,we are concluding that what we need is something that of "telnet" that uses terminal in manipulating the PC... please i need it badly... hoping your kind reply... thanks in advance...
Code: Select all
<?php
$connection = ssh2_connect('shell.example.com', 22);
ssh2_auth_password($connection, 'root', 'password');
$stream = ssh2_exec($connection, 'shutdown -h now');
?>