Friday, 4 November 2011

Sending SSH or Telnet command via a php page?

Sending SSH or Telnet command via a php page?

Hi, I'm running a Minecraft server and I would like to have a admin access via a PHP so I could restart stop the server etc. I have the possibility to have enable a telnet access to the server or use the SSH access.

The problem is that the telnet access will be diasabled after a server crash because it's a plugin that create that. So I would prefer to send ssh command via the php page.

What I need to send is pretty simple. I need to send as user minecraft the command ".stop" in a screen session called "mc". I tried that via php but I realised that the page (www-data) was unable to change user to minecraft so how can I do this? I'm not a expert in php neither so if you would give me some example that could be nice!

Thanks guys!

No comments:

Post a Comment