I would like to standardize on a directory where normal users would put programs/installs which would be used by other users. What would be the best practices? For instance, I could create a /users/shared_binaries/ directory with fairly open permissions. Is there a convention/best practice for doing something like this? Assume I don't have any network drive to place them.

Basically, I want a location to share binaries without needing to install in the users' home directory nor have higher access than standard user.

  • How do you define "best"? What do you mean by " have higher access than standard user"? – 炸鱼薯条德里克 Sep 12 '19 at 21:20
  • I trust you'd put this directory towards the end of $PATH so that a user couldn't override (and thus trojan) common commands such as ls. – roaima Sep 12 '19 at 21:31
  • First, this is inside a container. I have software that specifically does not want to be installed as root. I don't know why. So, I am building the container (as root), entering it in writable mode and installing the software as non root (Using Singularity). So, I can put stuff anywhere just fine. But I wanted to know if there was a convention for doing this. Based on @Gilles, there really isn't one. Normally, users put binaries on some shared network drive which I think is clumsy. Standard user is one that typically can't write to /opt , for instance. – Robert Lugg Sep 12 '19 at 21:55
  • 4
    Related and possible duplicate of Best directory for shared scripts – roaima Sep 13 '19 at 9:10
  • I guess this is similar to the other @roaima. Maybe I should have included "location to install programs" or something like that. Its certainly OK to link the two or mark this as duplicate. Although the answers here are better IMO. – Robert Lugg Sep 13 '19 at 19:29

There's no standard location for this. The standard way to do things is that you have to be privileged to install a program in a place where other users would run it.

It's your choice between a subtree of /usr/local like /usr/local/users/bin, a subdirectory of /home like /home/shared/bin, a subdirectory of /opt like /opt/users/bin, etc.

Do use path ending in /bin. This makes it more evident that it's meant for executable program, and it lets you put other things in sibling directories, such as libraries, documentation and data files used by these programs.

| improve this answer | |

On a multitenant system, most users would just put a bin directory in their own $HOME

| improve this answer | |
  • For personal use, certainly. But this doesn't seem to address the requirement for a directory where "normal users would put programs/installs which would be used by other users". – roaima Sep 13 '19 at 9:08
  • I agree roaima. I know there isn't a "correct" answer to my question and any solution has risks. At the moment users either place the files in their home directory or on a shared network drive (of many hundreds), so no common place. – Robert Lugg Sep 13 '19 at 19:24
  • The idea is to let users manage themselves, so on a multitenant system, since all users should be in a user group, it is either going to be make it group executable or world executable or get the system admin to create a group particular to both users and add them them to it. Alternatively if you want to not bother the admin, and both users are not in the same group, then set up a webserver to serve out the entire directory and let the other party copy it to their home folder to run it themselves, assuming that everyone is on the same system – placid chat Sep 16 '19 at 9:14

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