Quantcast
Channel: Switch user in a init script? - Stack Overflow
Browsing latest articles
Browse All 4 View Live

Answer by Henrik for Switch user in a init script?

For upstart, use:setuid myuserexec command args

View Article


Answer by Johan Nestaas for Switch user in a init script?

su is probably a more universal approach, but this is also possible on some common distributions with sudo:sudo -u $MUSER $COMMAND $ARGS(just reread your question and didn't realize that doesn't work...

View Article


Answer by guettli for Switch user in a init script?

I use this:su -l $MUSER -c "myCommand args..."Update: Since there is interest in this answer, I explain the way I use it here.We run servers as normal linux users, not root. The username contains three...

View Article

Switch user in a init script?

Here's my Init script which I have at my Ubuntu workstation. I need to run a command as another user than root, but I just can't get my head around how it should be done. Neither sudo -u or su newuser...

View Article
Browsing latest articles
Browse All 4 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>