Linux指定用户运行程序

可以参考文章: https://www.cnblogs.com/jmliao/p/11823209.html

具体事例:

#在root用户下,直接用以下命令来执行程序,程序执行后,程序隶属于用户git

su - git -c "nohup /home/git/gogs/gogs web >/dev/null 2>&1 &"
原文地址:https://www.cnblogs.com/faberbeta/p/linux-shell024.html