Results 1 to 6 of 6
Thread: PHP ssh app
Enjoy an ad free experience by logging in. Not a member yet? Register.
PHP ssh app
i havent messed with php in a long time as im a perl guy, however it does implement a system (or the like) function i remember. with that in mind you can do something like this:
$foo = system("ssh user\@host /path/to/command");
this probably isnt valid php code, but it should get you started. this also assumes you have setup passwordless access for the user using ssh keys.
note also that this is generally considered a bad idea as its a huge security hole. its better to write a script to be called from php on the local machine to do this for you and have the command and arguments hardcoded as to avoid possible exploits and call that local script through the system command and return its output.
no doubt, the security problems would be massive with somethign that just passed commands, thats why I was asking if anyone perhaps knew of a collection of scripts or summin that could handle this (like phpbb or squirrelmail) no worries, im not really concerned bout it, was just a thought, just when I get stuck at places with port 22 closed (annoyning as hell) RA might be nice through a web interface over port 80, but w/e.
- Join Date
- Jul 2007
Elegant way to do SSH in PHP
There's a very elegant way, using the ssh2.so module in PHP. A thorough article on how to set this up:
TechBlog - How to: Make SSH connections with PHP
It's got some source code examples as well.