How to run an Application as an additional customer?

I make use of krusader for documents monitoring things. the trouble is that apache is DocumentRoot needs to be under chown www-data:www-data /path/to/www. so making use of krusader (which is run under my account) I've not write accessibility to /path/to/www while I actually require. I do not recognize just how various other programmers can proceed doing points with such a constraint!

I asked yourself if I can run krusader as www-data after that I will certainly have the ability to conveniently have fun with documents. yet making use of su - www-data asked me for www-data is password!!

So, just how can I run an application (like krusader) as an additional customer (like www - information) in Gnome?

or exists any kind of various other remedy for my instance? (challenging I'm actually interested to recognize the solution!)

remember that I recognize I can run it as origin ! yet this will certainly create some approval troubles when making use of cp and also mkdir, you recognize.

PS: sudo and also gksudo did not aid:

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

Final Note : according the most effective solution, i did chmod u+w /path/to/www and also my trouble addressed. yet i still has actually not been done well in opening up krusader as an additional customer!

0
2019-05-13 04:07:52
Source Share
Answers: 6

Rethinking concerning this inquiry (I want to have actually recognized your trouble right, yet remedy me if I'm incorrect), I located an one more remedy and also I assume you do not require to run the application as www - information neither to have fun with permissions. You claimed that:

Apache is DocumentRoot needs to be under chown www - information: www - information/ path/to/www

yet in fact, this isn't totally real: Apache is DocumentRoot has to be legible by www-data, yet not always possessed by it. By default, in Ubuntu Desktop, all documents and also directory sites you create are legible by everyone, so you can set your DocumentRoot to a directory site inside your residence folder, as an example:

DocumentRoot /home/user/my-project/my-document-root
0
2019-05-22 20:40:09
Source

Both 'gksu' and also 'kdesu' are visual frontends for 'sudo', which is the device you need to make use of when you remain in a text - just setting. The 'gksu' and also 'kdesu' devices need you to be in a visual setting, that clarifies the "can not connect to X web server" mistakes.

if you intend to execute a console command as a various customer you make use of the command 'sudo - u username command'.

0
2019-05-18 10:16:11
Source

To come to be www - information with your very own password, utilize this:

$ sudo su www-data
[sudo] password for <your username>: [enter your password]
$ whoami
(you should see www-data here)

But, I do not assume you'll have the ability to run GUI applications from there.

I generally simply possess every little thing in /var/www, yet permit read accessibility to every person:

/var/www$ sudo chown -R [your-username]\:[your-group] *
/var/www$ find . -type d -exec chmod a+rx {} \;
/var/www$ find . -type f -exec chmod a+r {} \;

I wish that will certainly reduce your discomfort

0
2019-05-18 10:10:59
Source

Running a visual application under www - information offers you numerous troubles. A point you can do is including on your own to the www - information team, so you'll have the ability to transform all the documents you require:

sudo adduser $USER www-data

Note: possibly, you'll require to log out from the session for the adjustment to work.

If, hereafter command, you are still incapable to transform some documents, simply make certain that you have write approval on them:

sudo chown www-data:www-data /var/www/file
chmod g+w /var/www/file
0
2019-05-18 10:09:58
Source

If you are running this from the food selection system you'll intend to make use of alacarte (System > Preferences > Main Menu) and also transform the access for krusader and also include front of it: gksudo -u www-data which needs to generate something like:

gksudo -u www-data krusader

This will certainly release the management job motivate window which, according to the GKSudo Manpage, is a

GTK+Frontend for su and also sudo

Using simply gksudo without the -u button will certainly run the command as origin.

0
2019-05-17 17:11:22
Source

Like Marco stated you can make use of gksudo -u www-data <command> to run commands as an additional customer. I consistently utilize this to run commands as gdm therefore much it has actually never ever asked me for anything apart from my very own password.

If you are making use of kde the matching is kdesu -u www-data krusader. I assume, given that krusader is a kde application, it could function much better with kdesu. Even more information concerning kdesu here.

I have actually made use of gksudo to run commands as various other "human" customers on the system and also when I am motivated for password, I key in mine.

0
2019-05-17 16:02:12
Source