How to share a folder in Linux?

https://mander.xyz/post/48465992

How to share a folder in Linux? - Mander

I work on an HPC and often I have to share files with other users. The most approachable solution is to have an external cloud storage and recline back and forth. However there’s some projects that are quite heavy (several TB) and that is unfeasible. We do not have a shared group. The following is the only solution I found which is not to just set al permissions to 777, and I still don’t like it. Create a directory and set ACL to give access to the selected users. This works fine if the users create new files in there, but it does not work if they copy from somewhere else as default umask is 022. Thus the only appropriate solution is to change default umask to 002, which however affects file creation system wide. The alternative is to change permissions every time you copy something, but you all know very well that is not going to happen. Does it really have to be such a pain in the ass?

Uh, why not create the shared group? That’s more or less exactly the purpose of their existence.
A dedicated file sharing application.

What do you mean? Is there an application that allows easily sharing files on one Linux system? That would be nice!

If you mean going through an external server or peer to peer transfer, that is not too feasible. I do not have other storage places with tens of terabytes available, and transfering that much data through some P2P layer, while feasible, would probably be even less user friendly.

NFS Well if someone is running windows look for samba
s/ftp
scp
You could use pythons build-in http server
rsync
Setting Up File Sharing with NFS and Samba

Learn how to set up file sharing on Linux using NFS and Samba with this step-by-step guide. Covering installation and configuration across various Linux distributions, it details directory permissions, data reliability, and Active Directory integration. Perfect for both beginners and advanced users aiming to enhance network collaboration.

Linux Bash
This is a large computing cluster, there are no such mountpoints available and I’m definitely not allowed to go there and plug a few disks into the racks.
My answer regarding Sftp Scp Rsync remains unchanged. Rclone, Globus, Fuse
None of these programs allow overriding Linux permissions. You can not recline/rsync in another user directory. You can not sftp/scp in another user directory. My problem is not about transferring data across different systems, but rather accessing data on one system through different users. All users should be able to read and modify the files.
You can’t override user permissions. If you could they would be useless
I don’t want to override user permissions, I want it to be easy that users can agree to a directory being shared and in such directory group permissions get overridden by some laxer restrictions through explicit authorization of the user. I’d like for this to exist. This would not make permissions useless, just allow for an easy way to share files across users on a filesystem.
That is not how permissions work
… don’t they? usually, owner of the directory can change its permissions, and ACLs when those are enabled for the mount
Changing permissions is not the same as bypassing permissions
Skip NFS and ftp as they cause more problems than they solve

I’m no sysadmin, I just run my homelab. Let me get this straight… You want to bypass system level access level restrictions with some form of control but not go through your company’s standard method of doing so because of bureaucracy?

If that’s the case: why not put something in front Like opencloud for example?

I mean, maybe OC is not what you need, but conceptually… would a middleman solution work for you? If so, you could go with a thousand different alternatives depending on your needs.

Excellent file sharing - secure, simple, reliable. Start now.

Discover excellent enterprise cloud services with flexible, secure and scalable infrastructure that optimize efficiency and business processes.

A cloud solution is indeed an option, however not a very palatable one. The main problem with a cloud solution would be pricing. From what I can see, you can get 1TB for about 10€/month. We’d need substantially more than that. The cost is feasible and not excessive, but frankly it’s a bit of a joke to have to use someone else’s server when we have our own.

You want to bypass system level access level restrictions with some form of control but not go through your company’s standard method of doing so because of bureaucracy?

Yes. Not a company but public research, which means asking for a group change may lead to several people in the capital discussing on whether that is appropriate or not. I’d like this to be a joke, but it is not. We’d surely get access eventually if we do that, but that would lead to the unfortunate side: if we work in that way every new person who has to get in has to wait all that paperwork.

Don’t bypass your organizational policies

I am not bypassing any policy: the HPC Is there to collaborate on and data can be shared. Not having a shared group is not a policy, it’s just that not all users are in the same group and users are added to just one group by default. We are indeed allowed to share files, hell most of the people I want to share stuff with are part of my own research group. ACL is allowed on the HPC. I’m asking how to properly use ACL.

If you have anything actually useful go ahead, otherwise don’t worry that I know better than you do what I should or should not do.

You are in way over your head

Stop now before you get yourself in hot water

I would hire someone who knows what they are doing. It sounds like you are out of your element here which is risky.

To answer your question, you have a few options:

  • Samba

    • Samba is just a SMB server. If you have a local active directory setup use this.
  • SCP

    • this just copies files over a ssh connection
  • Rsync

    • this performs a sync of one directory to the other. It can run over SCP
  • Unison

    • like rsync but two directional. For it to work it needs to track state
  • Syncthing

    • never actually used it but it might be close to what you want.