Ubuntu 14.04 执行指定用户的命令

 

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

 或者

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

 

 

posted @ 2019-01-03 20:20  anobscureretreat  阅读(619)  评论(0编辑  收藏  举报