I am developing a control panel in PHP, i have the PHPsecLib libraries installed and am using it to issue commands to the remote servers.
For example;
$ssh->exec("cd /home/{$user}/{$id}; screen -S {$id} -A -d -m java -Xmx768M -jar minecraft_server.jar nogui -nojline;");
Now my question is, because i am issuing the commands as root, is this a security threat, even when all the commands that are ran, are pre-made/hard coded and not from user inputs.
If this is an issue, could anyone advise the best way of doing it?
Thanks,
Harry
You would not want to run as root. Rather, to harden the platform a bit if you are using sudo:
This would allow your user:
usernameto run screen without the need of sudo/password, but still require authentication for the rest of the executables on the platform.