Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

When I am root, how do I run one command as user "pi"?

Distribution Wheezy.

share|improve this question

closed as off topic by mdpc, Wesley, Ward, Bryan, Jenny D May 21 '13 at 7:35

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

Do not vote my question down if you cannot answer it. –  Zurechtweiser May 21 '13 at 0:20
You might get downvoted because Serverfault "is a question and answer site for professional system and network administrators", which you apparently are not. Your question is so basic that the simplest of Google searches could have answered it. There are also multiple similar questions (with answers) on this very site. –  daff May 21 '13 at 0:39

1 Answer 1

Use the su command with the following format -

 su - username -c 'command-name'

In your case

 su - pi -c 'command-name'
share|improve this answer
Thanks, that did it. –  Zurechtweiser May 21 '13 at 0:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.