Ubuntu 14.04 执行指定用户的命令

#!/bin/bash
sudo -u username /home/sco/start_server.sh

 或者

#!/bin/bash
su - username -c /etc/init.d/xxx.sh

原文地址:https://www.cnblogs.com/sea-stream/p/10216668.html