0

Possible Duplicate:
How To Execute SSH Commands Via PHP

I've searched here for some solutions but I couldn't find anything useful, so I'll just ask it.

OK, so what I want to do is a SSH Remote Connection FROM my website to the remote server machine. Both are Windows for now but I'll get some Linux servers soon so I will have to make it compatible with Linux systems. Well, back to topic. I'm currently trying to create a Game Server Control Panel in PHP which will start and stop .exe's over the internet on my Dedicated Servers, but I need to know how to do it in PHP.

I've currently not come up with anything at all because this is still an idea of mine. I know I should make it in ASP.NET but I have no knowledge in ASP.NET whatsoever.

I've installed Cygwin Server on my remote machine and it's working.

How do I make a PHP SSH Connection to my remote machine(s)?

EDIT: I have full root access to both machines.

4
  • 1
    PHP vs ASP make up your mind ;) Commented Oct 22, 2012 at 16:35
  • 1
    Why not just create a web service? seems to be a better option Commented Oct 22, 2012 at 16:35
  • 2
    php.net/manual/en/function.ssh2-connect.php Commented Oct 22, 2012 at 16:36
  • 1
    Getting libssh2 working on a Windows box is a PITA. Try phpseclib, a pure PHP SSH implementation, instead: phpseclib.sourceforge.net Commented Oct 23, 2012 at 14:24

1 Answer 1

0

You should be able to use PHP's exec() function to execute a script to do what you need. See here: http://php.net/manual/en/function.exec.php

Sign up to request clarification or add additional context in comments.

1 Comment

Eugh. Dropping down the shell should be the last resort. There is at least one perfectly good SSH library available for PHP.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.