Run Command As Another User

su - root -c "your command"

 

su - yourUserName -c "YourCommand"

 

 

详细参考

来源:https://www.cyberciti.biz/open-source/command-line-hacks/linux-run-command-as-different-user/

 

posted @ 2024-02-19 13:48  profesor  阅读(5)  评论(0编辑  收藏  举报