2

I thought that the purpose of the Public folder was to share with other users on the computer. Anything added there would be made available instantly to the other users on the computer. However, that does not appear to be the case. Is there a way to make this happen?

on the left an empty Public Folder - On the right, the supposed shared

0

A simple (but not secure) solution:

  • Each user must change the access rights to their personal Public folder (~/Public) to 777. In Files open the Properties dialog and choose the permissions tab. Click on the "Write" buttons for "group" and "everyone".

  • Once this is done you can create a link to another user's Public folder in your own home directory (or anywhere you can write to) by either

    • dragging and dropping that folder with the secondary (right) button or
    • using "Copy as Link" and "Paste" context menu options.

Another solution is to open a Files window as Administrator (right-click on dock icon) then create a global Public folder in e.g. /opt. Change the permissions to 777 as before. Then each user can create their own link to that folder in their home directory.

2

If you want one folder for all users, yes it is possible.

Before you start, please empty both the Public folders in order to prevent data loss. I will use into the command lines below user1 and user2 but you have to replace these strings with the actual usernames you want to manipulate. The Public folder's icon of the Public folder of user2 will be changed, with an arrow sign informing that this is actually a simlink. All the commands have to be typed (or copy-paste and edit the user1 and user2) into Terminal application line by line and pressing Enter. You have to do this logged in into user1 account. You will use the sudo command, which gives you administrative rights and that's why you will be asked for a password, probably only the first time you are using it.

1. create a custom group for both of the users

sudo addgroup sharedfolder

type your password and hit enter

2. add both users into the group

   sudo adduser user1 sharedfolder

   sudo adduser user2 sharedfolder

3. Change ownership of the Public folder to the new group

sudo chown user1:sharedfolder /home/user1/Public

4. Change folder permissions in order to achieve the effect:

sudo chmod 2775 /home/user1/Public

Explaining the permissions 2775 in the chmod command above:

  • 2 – turns on the setGID bit, implying–newly created subfiles inherit the same group as the directory, and newly created subdirectories inherit the set GID bit of the parent directory.
  • 7 – gives rwx permissions for owner.
  • 7 – gives rwx permissions for group.
  • 5 – gives rx permissions for others.

(r=read, w=write, x = execute)

5. Rremove the Public folder of user2:

sudo rm -rf /home/user2/Public

this will delete the folder with all contents and there is no easy way to return them back so you better not having there anything.

6. Navigate to user2 home folder:

cd /home/user2/

7. Create a symlink into the user2 home folder to the Public folder of user1:

sudo ln -s /home/user1/Public

Now any file you copy and paste or create into the Public folder will be with 2775 permissions and a sharedfolder group.

If you cut some file from somewere and paste it there, the permissions will not be changed and probably will be locked for the other user unless you change group (sharedfolder) and permissions (775) before you log in into the other account.
You can do this using your file manager, right click over the file or folder > Porperties > Permissions tab. See the folowing images for info, but much more easier is to copy/paste and delete source. navigate to file propertieschange Group and permissions

  • does changing the group make it any easier for others to see this folder? – Marcelo Hosannah Nov 13 '19 at 22:53
  • I don't seem to be able to see the folder in Files while logged in to other users... See, I have a user set up for my personal account, and one set up for my professional account, as different users on elementary. I have some files in my personal account that I'd like to share to my work account. I though saving the file in the Public folder would make it available for all users. So I'd just login to my work account and pick up the file there... but that does not work.. – Marcelo Hosannah Nov 13 '19 at 23:01
  • 1
    Public folder in your work account is placed into /home/work_account/public file location, for the personal one is into /home/personal_account/public. These are two different folders in order every user to have a folder where he/she can share information into the local area network for example. If you want to use one folder for all local accounts instead, you can replace one of the public folders with aliaces to the other one, create a new group, add both users to this group, and change ownership of this folder to the new group. Do you want a command line for that? – Bo rislav Nov 14 '19 at 5:54
  • I see... That explains a lot. Thanks! I would appreciate a command line for that, yes please! And thank you very much! Can this be done using the graphic interface? – Marcelo Hosannah Nov 15 '19 at 23:46
  • As far as I know it is not possible only with graphical interface. But the good news are that you have to do this only once. I will edit my answer above because it is not so comfortable to do this with a comments, also it can be usefull for someone else. – Bo rislav Nov 16 '19 at 13:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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