在root 用户去执行其他用户的脚本

/usr/bin/su xiaowei -l -c "whoami"

原文地址:https://www.cnblogs.com/hixiaowei/p/7828949.html