Linux下以特定用户运行命令

方法汇总:

1、su

2、sudo

3、runuser

比较常用的方式:su

su - www -s /bin/sh -c "/bin/php /www/com/artisan schedule:run",解释:以www身份,用/bin/sh运行命令。

原文地址:https://www.cnblogs.com/caohongchang/p/14428651.html