How to run an Application as another user?

Posted by takpar on Ask Ubuntu See other posts from Ask Ubuntu or by takpar
Published on 2010-10-09T15:11:24Z Indexed on 2012/03/24 11:38 UTC
Read the original article Hit count: 326

Filed under:
|

I use krusader for file management stuff. the problem is that apache's DocumentRoot should be under chown www-data:www-data /path/to/www. so using krusader (which is run under my account) I've not write access to /path/to/www while I really need. I don't know how other developers can continue doing things with such a restriction!

I wondered if I could run krusader as www-data then I will be able to easily play with files. but using su - www-data asked me for www-data's password!!

So, how can I run an application (like krusader) as another user (like www-data) in Gnome?

or is there any other solution for my case? (tough I'm really curious to know the answer!)

keep in mind that I know I can run it as root! but this will cause some permission problems when using cp and mkdir, you know.

PS: sudo and gksudo did not help:

$ gksudo -u -www-data krusader
No protocol specified
krusader: cannot connect to X server :0.0

Final Note: according the best answer, i did chmod u+w /path/to/www and my problem solved. but i still has not been succeeded in opening krusader as another user!

© Ask Ubuntu or respective owner

Related posts about gnome

Related posts about sudo