|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Idea #3916: Easy file sharing between local users
|
Written by kamil.paral the 8 Mar 08 at 21:20.
Category: Accessibility.
Related project:
Nothing/Others.
Status: New
|
|
|
Rationale
Currently there is no way to easily share files between multiple local users. I am talking about full read-write access to particular folder, eg. music folder.
Example: Alice and Bob uses the same computer. Alice has read access to Bob's home folder. Bob has read access to Alice's home folder. They want to fully share (read/write) their music. So they should ideally create /home/music folder, put all the music there and use it. Everything Bob puts into there, Alice should be able to read and remove, and vice versa. This is currently impossible in Ubuntu. Bob has to manually fix permissions every time Alice wants to delete something Bob's (Bob creates /home/music/Britney, but Alice can't delete /home/music/Britney/song1.mp3).
I have discussed this issue with several linux gurus and there is currently no easy nor difficult way to achieve this in Linux on the same (ext3) partition. With every proposed solution I can give you counterexample (group permissions, ACLs, local Samba, local NFS, etc - there is always problem when moving files). There would have to be created utility to set shared folders and some daemon would have to monitor changes and modify permissions.
Currently the easiest solution known for me is to share files on separate (ironically) NTFS partition, because when mounting NTFS you can force user/group/permissions on file access. What a shame, we use Microsoft technologies just to share files between Ubuntu users.
This problem is quite serious, give it a thought or two. Everyone who is not using Ubuntu computer alone and wants to share music/films/etc between multiple users knows what I am talking about.
//New info:
Atany has proposed in the comment that BindFS project can be used to achieve this functinality:
http://code.google.com/p/bindfs/
I have tried it and it works very well. Developers which would like to implement this idea should have a look on BindFS, it's very promising tool, it could provide all necessary background for this.
|
|
Developer comments
The proposed inotify/chmod hack in https://wiki.ubuntu.com/LocalFileShare would probably work to some degree, but I think it is subject to race conditions, and also not very flexible.
A slightly better solution would IMHO be to provide the shared directory through FUSE; then we can impose dynamic size limitations (at most use 2/3 of the available space in /home, etc.), fine-grained dynamic permissions, and avoid a lot of inotifying and permission race conditions.
Once this is solved and provided by default, we should reconsider " #6106: Make so other people cant access your home directory", which we didn't do yet in order for people to be able to share files r/o.
Propose your solution
Attachments
Duplicates
Comments
|
flomar
wrote on the 8 Mar 08 at 22:01
|
|
|
hi,
i did not encounter this problem yet. however i do not understand why the solution should not be simply a group 'music' and alice and bob are both members of this group?! could you post a thread where you discussed this topic with the linux gurus? ;)
Flo
|
|
|
Hardly someone would understand, since it was in czech language. To the "group" problem:
Simply download/create folder "Nirvana" with some songs. The default permission is read+write for owner ("Bob"), read for group ("music"), read for others. Move it to shared folder. Alice can't delete Nirvana/song1.mp3.
You can modify your umask to have default write access for group for newly created files. However, all applications are not obliged to honor this and may create your files with different permissions (and many of them do).
|
|
ebrahim
wrote on the 8 Mar 08 at 23:00
|
|
|
|
I have this problem and my solution has been (unfortunately) a FAT partition! (for the same reason that author said)
|
|
|
It does sound like a seperate partition is one good way to address this problem. (The other being a daemon as suggested).
If the partition is mounted so that permissions are not applied then everybody can use it.
I am no expert, but checking the man page for mount suggests that standard Linux partitions do not offer this feature.
FAT since it is a very basic system without permissions allows this solution to be implemented.
Unfortunately FAT does not offer long file name support which is very bad news if you are trying to store your music!
FAT32 which does offer (crummy) long file name support is covered by Microsoft patents.
It looks like a new option to mount a standard EXT2/3 partition without permission checking is required.
|
|
zcat
wrote on the 9 Mar 08 at 00:48
|
|
|
Lots of people saying how to do it; but that's not what was asked for.
Advanced users know how to add a group, put users in it, make a folder owned by that group, make it sticky so other users get access to first user's files, etc. YourMum does not.
YourMum wants to right click, see the option "Share this folder with everyone on this computer" and have it WORK. It's really sad that the easiest way of doing this right now is by using a fat32 or ntfs filesystem.
|
|
zcat
wrote on the 9 Mar 08 at 01:02
|
|
|
I just had a better idea;
In the default install, have a directory somewhere (/home/shared? /media/shared? /usr/share/shared?!) that is owned by nobody and rwxs for everybody. Make a simlink to it in every user's home directory as is done with Examples/
This would satisfy most people. They can add their own Music / Movies folders under Shared and they'll automagically be shared with everyone.
|
|
Strong
wrote on the 9 Mar 08 at 01:21
|
|
|
This is not a neat solution but it will work for you.
Create a group called music and add the users. Go to the settings of each user and change the 'Main group' to music. Log out and in.
After this, all newly created files will have music as group.
Now you only have to bind the existing files to the group music, grand write permission to the files and execute permission to the directories.
# sudo chgrp -R music /home/music
# sudo chmod -R g+r+w+X /home/music
(use a capital X otherwise all files will get execute rights!!)
The only disadvantage is that all of these users can also poke in each others home directory.
|
|
|
I agree with xcat's post. I, myself have actually thought of doing the same. I think the folder should be called /home/Share
A symbolic link in each user's ~ directory would be great!
|
|
johno
wrote on the 9 Mar 08 at 08:32
|
|
|
You can do it by creating a group, then create a folder with rw permissions to that group, and then set the sticky bit on the group permissions (so new items get that group owner), then add the necessary users to that group, and then try to get the umask set appropriately by default for each of the different login methods.....
But really, that's just totally impractical for average user sharing. One more suitable possibility is to set up an interface for making samba shares of directories easy to create and mount by the other user.
|
|
|
1) Sharing files on different (NTFS/FAT32) partition is a solution, but very impractical. You don't have symlinks, it's not native FS, you always fight with disk space (you created the partition too small or too large), you can't just move file instantly (it's always copying files, which takes time). Works, but far to ideal.
2) All of your suggested solutions I have tried and *they do not work*, believe me. There is always some flaw in it. When Bob creates folder with files in his home and moves it to shared folder, permissions won't change. Sticky bit doesn't help either. Same primary group with modified umask sounds good, but all programs doesn't honor this and there are some security concerns. There's always something. And I am not a linux newbie.
I wouldn't like to explain all the problems with different methods, because it can be really time and space consuming to show reasonable example. And this is not a technical support forum. I would like to point out that this problem exists and it's non-trivial even for experienced linux users, and so that Ubuntu developers should explore this and try to create some user-friendly solution.
So please, don't post another "solutions" (they won't work perfect anyway:), just vote for this issue and let Ubuntu developers know about it and do something about it! Thanks :)
|
|
|
In Rhythmobox, ther'es a plugin really great who autorize poepel to read the music of the others poeple who are running rhythmbox.
There's a link in the left column whiwh permits to acces (with or without a password) to the music of the others.
This plugins is in french "partage de musique DAAP".
It's really cool. I recomend it for sharing music ! Enjoy ! :-)
|
|
dee70
wrote on the 9 Mar 08 at 12:37
|
|
|
This annoyed me to the pinnacle of annoyance when I first started using Ubuntu. I took a long time to figure out how to do something that I consider tolerable.
I wound up making a group and then making a script in rcS.d called S81_Share:
chown -R firstuser:thegroup "/Share"
chmod -R ug+rwx,o=rx "/Share"
Works but its not great. After one user adds files, the computer must be restarted before others can edit or rename them. And I think everything is set to executable but I don't let that bother me. Also this could be the reason my computer boots up slow but again I don't let that bother me.
|
|
Xan
wrote on the 9 Mar 08 at 18:44
|
|
|
|
The same for editing openoffice files, etc.
|
|
Xan
wrote on the 9 Mar 08 at 18:45
|
|
|
|
It could be useful to click right button and select "share it to..." open a dialog and select the users you want to share the file or directory.
|
|
|
|
To all who haven't understood (svergeylen, Radon, etc): This is about sharing files between LOCAL users. No network, no Internet, no LAN, no servers; just local users.
|
|
ernstp
wrote on the 9 Mar 08 at 19:34
|
|
|
|
I've been running the "umask" solution for a while now, it works very well IMHO. There was a fix for Nautilus a while ago to make it honor umask.
|
|
|
|
sounds like what is needed is the OPPOSITE of root... a NON protected user/group setting.
|
|
Konst
wrote on the 9 Mar 08 at 20:25
|
|
|
I've never thought of this problem, 'cause I have shared /home/common directory to copy movies etc. for my father, but he has never tried to delete those files.
This is really a problem.
|
|
mcglnx
wrote on the 9 Mar 08 at 20:27
|
|
|
A good one!
Would like to see some common 'family' resources! Would be great!
|
|
surban
wrote on the 10 Mar 08 at 09:30
|
|
|
What about ACLs?
Citing the acl(5) manpage:
OBJECT CREATION AND DEFAULT ACLs
The access ACL of a file object is initialized when the object is created with any of the creat(), mkdir(), mknod(), mkfifo(), or open() functions. If a default ACL is associated with a directory, the mode parameter to the functions creating file objects and the default ACL of the directory are used to determine the ACL of the new object:
1. The new object inherits the default ACL of the containing directory as its access ACL.
...
I have not tried, but I think it can be used to fix the problem.
I suggest that the root filesystem should be mounted with ACLs on by default (e.g. add acl to options in fstab). Nautilus should be extended to allow modifying ACLs and automatically ask for admin permissions if the user's permissons do not suffice for an operation. (like Vista and Mac OS X)
|
|
|
|
As I said, neither ACL will help. When moving files they retain their original permissions.
|
|
popi
wrote on the 17 Mar 08 at 10:01
|
|
|
we should make a /home/shared folder with a special umask.
it could be an enough practical solution.
|
|
|
I agree that my idea is a little bit related but IMHO it's not a duplicate. I'm advocating a more secure umask for the homedir and a special "public" readable folder where users can put files they want others to be able to read/open. This is a security idea.
On top of this a special folder where all users can read and write is very nice but it's not the same.
|
|
|
I agree that my idea is a little bit related but IMHO it's not a duplicate. I'm advocating a more secure umask for the homedir and a special "public" readable folder where users can put files they want others to be able to read/open. This is a security idea.
On top of this a special folder where all users can read and write is very nice but it's not the same.
my idea which is marked as a duplicate but shouldn't be marked as a duplicate IMHO :
homedir should be private with a special "public" readable folder
http://brainstorm.ubuntu.com/idea/5287/
|
|
TBH
wrote on the 28 Mar 08 at 13:51
|
|
|
|
Is it really needed? I believe not, learn to use chmod and group creating.
|
|
bjwebb
wrote on the 30 Mar 08 at 20:49
|
|
|
|
TBH - yeah, maybe I or you can do that. In fact, I have done that, I even wrote my own daemon script, but its a hassle. And its not practical for Joe Bloggs user. This is something the Ubuntu team should really sort out. A comprehensive solution that deals with the issue of file moves would be best; but just creating /home/shared and symlinks during install would be better than nothing!
|
|
atany
wrote on the 4 Apr 08 at 18:41
|
|
|
I've had the same problem until I found BindFS project
http://www.cs.helsinki.fi/u/partel/bindfs/
It uses FUSE and allows some extra access manipulation, e.g.
/usr/local/bin/bindfs -M @users -o nonempty /opt/share /opt/share
makes /opt/share fully accessible by all users from @users group (can be done automatically at boot)
|
|
Kosava
wrote on the 16 Apr 08 at 11:59
|
|
|
|
it will be nce to integrate http or ftp file sharing server easy to share on local network like HFS or guildftpd servers on windows programs with GUI
|
|
|
|
atany: Thanks, that looks very promising! Of course only for professional users. For common users this issue stays.
|
|
Ohb01
wrote on the 22 May 08 at 05:02
|
|
|
I totally support this idea. I would like to share with all local users an external USB drive where we store our family photos and videos -- or at least a folder on that drive.
When we switch users in Ubuntu 7.10 (not upgraded to 8.04 yet for other reasons), we have to unplug the drive and plug it back in (either the USB or the power cable to the drive). Otherwise, the new user does not even see the drive. This is awkward, and I always fear data loss from unsafe device removal. (Unmounting before switching users gives error messages sometimes). No such problems with the same drive in Windows XP though -- all users see it by default.
I suppose Linux security originated on servers, where you may not want users to share each-other's files or local USB drives. But the opposite is often true for a home desktop.
I've tried using groups and permissions via the Nautilus/GNOME GUI, but it does not seem to work.
The USB drive is Western Digital "My Book" 1 TB, which uses a VFAT32 file system. I would hate having to reformat to a Linux file system if this means having to back up and restore all the data.
Thanks for supporting an enhancement to Ubuntu in this area.
|
|
jonwwren
wrote on the 31 May 08 at 22:25
|
|
|
|
I agree with this idea. My wife an I use a digital camera and I want to set up a folder where I can copy the photos where we can both view and edit them.
|
|
subharo
wrote on the 24 Aug 08 at 15:29
|
|
|
Here is a possible really simple solution. You'll slap your forehead when you read it, as it's so simple.
Symbolic links have been mentioned a few times so far, but what about those rarely-used, often-neglected hard links?
How about each users ~/Public is a hard-link to the first user's (ie. having UID 1000) ~/Public folder (therefore all ~/Public folders effectively being the same folder, as far as the filesystem is concerned)? This first user's ~/Public folder would have system-wide writable permissions (drwxrwxrwx), created when Ubuntu is first installed. Then whenever a new user gets created, a hard link is created to that first user's (or any other user's, should that first user not exist anymore) ~/Public folder.
With symlinks, a separate folder has to exist somewhere (which all the symlinks point to), and then you have the problem that nobody can agree on where that separate folder should be. Under /opt? /usr/local? /home? The Filesystem Hierarchy Standard (http://www.pathname.com/fhs/) falls short of suggesting any such standard, proper place to put such a folder, despite it's obvious value.
But with hard links, this confusion goes away, as all /home/*/Public simply IS the same folder.
After all, all users home directories will live on the same partition, namely /home, so it's safe to use hard links (since you can always safely assume you'll be staying on the same partition, be it / or /home).
One advantage of this is that with hard links, Tracker (or any other program that might balk when it encounters a symlink) will have no qualms about indexing inside ~/Public, because it seems like a regular folder.
|
|
|
|
subharo: You can't create hardlinks to directories.
|
|
alexroux
wrote on the 14 Sep 08 at 15:57
|
|
|
bindfs is a great for my similar issue. Here is how I got it to work on Ubuntu 8.04.
* Get and compile:
cd /tmp
wget http://bindfs.googlecode.com/files/bindfs-1.8.tar.gz
tar xzvf bindfs-1.8.tar.gz
cd bindfs-1.8
sudo apt-get install libfuse-dev build-essential
./configure
make
sudo make install
* Share my /home/common folder as /home/shared for uses alex, john and jack
sudo /bin/mkdir /home/shared
sudo /usr/local/bin/bindfs --mirror-only=alex,john,jack /home/common /home/shared
* Make this at reboot time so that it works over NFS (accessing from Windows/Ubuntu PC)
sudo gedit /etc/rc.local
and copy the 2 lines above in it
|
|
biji
wrote on the 18 Sep 08 at 03:26
|
|
|
hi i found simple solution... using vfat loop file
i put loop file in /shared
dd if=/dev/zero of=pic.loop bs=1M count=2000
mkfs.vfat pic.loop
automatic mount to /shared/Pictures in fstab:
/shared/pic.loop /shared/Pictures vfat umask=000 0 0
then all user can share file to /shared/Pictures
|
|
|
I support the idea what who suggest use a folder like '/home/Public' with stick bit (drwxrws---) owned by nobody and included in a system group called shareddoc, for example.
The problem is how can users allow others users change their files in this folder. It because the umask on Ubuntu system is 0022, so all files in that folder would be read-only for shareddoc group's members. It's a security risk change the umask so my suggestion is a daemon that watch changes in files inside this folder, using DBUS or other magic resource.
Everyone who I'd want to allow to access that folders I just include this guy in that group.
I know it is so easy to do, but I'd love if a wizard or similar could help me to do it. A Single button in folder property that I just click and would be able to include a new member in that group.
I'm sorry about my English.
|
|
airkayu
wrote on the 11 Sep 09 at 10:25
|
|
|
|
I agree with his findings i.e. FUSE filesystem Daemon. I have rewritten the procedure on how to get this local share between users to be done easily on http://airkayu.com/node/24 just in case you are still in maze.
|
Post your comment
|
|
|