unable to create directory under /opt
Dear Members,
On linux, as non-root[oracle] user am not able to create directory under /opt. It says Permission denied. But I understand /opt should not be specific to root, since the application installed as non-root gets installed under /opt. any idea as how to create directory under /opt ? cheers Sud |
Hello,
Because opt is located in / itself, it is owned by root. So technically saying, yes, /opt IS specific to root. Now what you can do is create a directory as root within opt, then change the ownership and permission of that newly created directory, and voila, there you go. Cheers, Josh |
Thank you. The step suggested by you will work and will be sort of work around. I have observed that on other linux system I could see many directories under /opt which does not belong to root. Is it something to do with user account ?.
|
More of the permissions and ownership; Look at the following:
Code:
/ |
Ok. Thank you. But I guess there wont be serious security breach if permission is given to /opt since system specific files are not present under /opt.
|
True, but it's the thought. I would never do that, regardless if files were to be compromised or not.
|
You could also set the sticky bit, e.g. 'chmod 1777 /opt', similar to how the '/tmp' directory is configured. That way anyone can create files and directories there but only the owner of files and directories under '/opt' can delete or rename them.
|
Re: Unable to create directory under /opt
I’ve had to do something similar with various applications. If you want to create a usable directory in /opt
that user oracle can access and still maintain the permission/security integrity of /opt, do the following: oracle$ su – # become root # cd /opt # mkdir oradir # hypothetical directory name # chown –R oracle:oracle oradir # make user oracle the owner # ls –la -rwx-r—r-- oracle oracle oradir # exit # get out of root oracle$ cd /home/oracle # cd to whatever directory to create a link (optional) but suggested oracle$ ln –s /opt/oradir oradir # create a link as the user needing access to the directory It’s worked for me pretty well. The good thing is that you don’t have to compromise the permissions for the entire /opt directory, just the directory within /opt that you need to access. |
All times are GMT -5. The time now is 01:30 PM. |