Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux /opt/* folder and permissions [closed]

I'm using the folder /opt/ to install common software that would otherwise not be available as part of the package installer of the system and that should be available to many (developer) users in Linux (using Ubuntu at the moment):

/opt/dev/eigen/3.1.3
/opt/dev/boost/1.54
/opt/git/myproject1.git
/opt/git/myproject2.git 

Putting the common software there would be the common practice right? how about permissions? I tend to chmod -R 777 /opt/dev but this is a very bad practice I guess. Suggestions on best practices in this area? probably something along the lines of adding a developers group and giving them all permissions or?

Note git is a special case but still all developers need access to it because pushing changes implies creating directory and files under that path with the developer credentials.

like image 474
SkyWalker Avatar asked Jul 09 '13 19:07

SkyWalker


1 Answers

According to these sites:

https://bbs.archlinux.org/viewtopic.php?id=35867 https://askubuntu.com/questions/169314/default-permissions-for-opt-directory

plus my experience, a correct permission to use is 755 for subdirectories in /opt. If your useris part of the root group, you could also set permissions to 775. You should be fine with this as long as there's nothing considerably sensitive in your /opt folder. If there is, then you might consider storing those in a separate subdirectory from /opt with even more limited permissions.

like image 155
mh00h Avatar answered Sep 23 '22 19:09

mh00h