通过php在远程服务器中执行shell命令

时间:2020-10-18 00:46:55

标签: shell shellexecute

我需要帮助在本地服务器上创建PHP脚本以执行远程服务器中的某些ssh命令。

<?php  
$usertoRemove = "2222";

$Command1 = 'rm -f "/etc/user."$usertoRemove".".conf"'; //Remove Remote File
$Command2 = 'systemctl restart "wg-quick@wg0"'; //Restart Remote Service

# Code To Connect to remote server and execute the above 2 commands

?>

任何帮助将不胜感激。

谢谢

0 个答案:

没有答案
相关问题