0

This question already has an answer here:

hi so I have installed xampp on my Ubuntu laptop and I want to give the user "John" full permissions on the folders /opt/*

How can I do this? Right now you need to be root

marked as duplicate by Gunnar Hjalmarsson, Pilot6, Eric Carvalho, karel, Ron Jul 22 '15 at 18:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

According to here, to set security for xampp, you can run the following commands:

sudo -s
/opt/lampp/lampp security

answer:

yes

to all questions and create a password for each of the categories.

When you are finished, don't forget to type:

exit

and

sudo -k

Now, on the index.php page it should ask you for a username. The default username is

lampp

Use the password you created for the password.


It is not recommended you give permission to john instead of root for security purposes. That is one of the many reasons viruses are so easily to install on a windows system because you don't need root permission to install applications. Many applications install to the opt directory.

If there is something you want to do to files in that directory, John can use the sudo command to alter those files.

If you want to use your file manager to alter files, you can start the file manager using gksu to give john temporary permission to do whatever it is you want to do without defeating the secure structure of having a nix based system.

First, to install gksu, run the following commands:

sudo apt-get update
sudo apt-get install gksu

Press ALT + F2 and then type:

gksu nautilus

and then press ENTER.

You will be prompted for your password and then the file manager will open with root permission so BE CAREFUL.

-1

It'll be better if the '/opt' folder isn't writeable from a normal user but to give John full permissions to a it, you may make him the owner of the directory and it's contents.

Use the following command (expecting the username is John):

sudo chown -R John /opt

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