LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cannot copy to my /opt folder ? (https://www.linuxquestions.org/questions/linux-newbie-8/cannot-copy-to-my-opt-folder-800435/)

Twin Cams 04-06-2010 04:59 PM

Cannot copy to my /opt folder ?
 
Hello all,

I installed Kubuntu 9.1 and then I downloaded Xampp of Linux to the desktop, however I have to extract it to /Opt/lampp. And that's the problem.

I don't seem to have access or permissions to ??

I tried right-click | properties | permissions but the fields are greyed-out to make any changes.

I am logged-in using the same user id/password I created when installing K9.1.

Any suggestions, please explain in layman terms so that I follow your flow. Thanks!!

devnull10 04-06-2010 05:02 PM

run the command "ls -la /opt" and post the output here. Also, post the username you are logged in as and the results of the command "groups <your username here>".

Thanks

Twin Cams 04-06-2010 06:33 PM

Quote:

Originally Posted by devnull10 (Post 3926721)
run the command "ls -la /opt" and post the output here. Also, post the username you are logged in as and the results of the command "groups <your username here>".

Thanks

This is the output:

total 8
drwxr-xr-x 2 root root 4096 2010-04-05 23:16 .
drwxr-xr-x 21 root root 4096 2010-04-05 22:48 ..


I don't understand the last part about the groups ???

nonamenobody 04-06-2010 09:09 PM

Quote:

Originally Posted by Twin Cams (Post 3926717)
I installed Kubuntu 9.1

Just to be pick it is 9.10 (nine point ten), as it was released in the then tenth month of 2009 (that is the naming scheme for (K)Ubuntu)
Quote:

and then I downloaded Xampp of Linux to the desktop, however I have to extract it to /Opt/lampp. And that's the problem.
'/Opt' would certainly be a problem in a case sensitive operating system like Linux.

Quote:

I don't seem to have access or permissions to ??

I tried right-click | properties | permissions but the fields are greyed-out to make any changes.

I am logged-in using the same user id/password I created when installing K9.1.
Permission to alter/create files in '/opt', no you won't have. Ubuntu doesn't give you direct access to a user account with many privileges (there is only really one privileged user in a Linux/UNIX system and that is root). Root logins are disabled in Ubuntu by default. However they do give you method to temporarily elevate your privilege (at last for the first user you create, you have to allow it for other users) - it is called sudo and it is not very different from Windows' run as and UAC, though if you are running GUI apps you will want to run kdesudo or gksudo (e.g. press ALT+F2 and enter 'kdesudo konqueror'). In KDE there may even be a 'Run as Root' option or 'File Manager as Root' in the menus), I don't recall, it has been a while.

grail 04-06-2010 09:10 PM

So your output of the ls shows that only root user has the rights to create (the 'w' part is write ie create folder/files)
folders and files in /opt, so unless you are root or change the permissions you cannot.

Secondly, the username part i am sure you understand (ie mine is grail), so if at the command prompt
you type(> is the prompt):

Code:

>groups

or

>groups grail

This will display which group(s) you are a member of.

devnull10 04-07-2010 03:48 AM

Well, for /opt, you need to be root which I would imagine you aren't.
My suggestion would be to use groups. The other (far less preferred) options are to change ownership or make the permissions 777.
The output from "groups user" will show you what groups you are already a member of. You might want to create another, say "system" and add yourself to that group, then chgrp /opt to that group, setting the sticky flag. This must all be done as root.

Twin Cams 04-07-2010 06:00 PM

Ok, think I got it, the output for groups: adm dialout cdrom plugdev lpadmin admin sambashare

The CD I installed from is: Ubuntu Family 9.1 Karmic Kola

grail 04-07-2010 07:21 PM

So as devnull suggested, maybe change the group to admin (which you are a part of) and alter permissions to maybe 775 and then you should be right.
Obviously you should weight this against which other users you have in this group and if they should all require this access as well.

Twin Cams 04-07-2010 07:48 PM

Quote:

Originally Posted by grail (Post 3928006)
So as devnull suggested, maybe change the group to admin (which you are a part of) and alter permissions to maybe 775 and then you should be right.
Obviously you should weight this against which other users you have in this group and if they should all require this access as well.

Thanks again...

Can you list out the steps of how I would go about accomplishing this???

No one else would be using this computer so that's not a problem.

Much thanks.

devnull10 04-08-2010 01:21 AM

chgrp admin /opt
chmod 775 /opt (or chmod 2775 if you want the sgid flag set).

Twin Cams 04-08-2010 08:18 AM

Quote:

Originally Posted by devnull10 (Post 3928252)
chgrp admin /opt
chmod 775 /opt (or chmod 2775 if you want the sgid flag set).

Ok, will give this a go when I get home.

And what does: sqid flag set means....so that I understand what that option is. Thanks.

bsat 04-08-2010 09:12 AM

hi the reply is just what nonamenobody has said.... you got to use sudo you would not need to change any permissions i think.
for eg if you are running from the command line

sudo "command".

devnull10 04-08-2010 11:10 AM

Damn - didn't notice he was running a belts and braces version of Linux! ;)

Twin Cams 04-08-2010 02:19 PM

Quote:

Originally Posted by bsat (Post 3928583)
hi the reply is just what nonamenobody has said.... you got to use sudo you would not need to change any permissions i think.
for eg if you are running from the command line

sudo "command".

O-k-a-y. I'm trying to follow along here, so please bear with me...

So if I use sudo 'command' what is the actual command do I use to give permissions to that /opt folder?

I'm trying to understand this, but haven't had the, Ah-ha! moment yet.

grail 04-08-2010 11:30 PM

Basically whatever the 'command' is you would execute normally and then just place sudo in front.

Code:

as user: chmod 775 /opt

Above receives error that you are not allowed

using sudo: sudo chmod 775 /opt

On enter you will be asked for your password



All times are GMT -5. The time now is 02:33 AM.