Ubuntu – Standard users are unable to share their respective “Public” folders

19.10sambasharinguser-management

The only user that is able to share the "Public" under their home directory is the original user that was created at installation. Sharing is accomplished through the file manager by right clicking on the Public folder, selecting "Local Network Share" and completing the dialog.

This process fails for any other user created through the GUI for reasons due to "permissions".

Best Answer

There are 3 issues with sharing of "Public" folder by standard (non-administrator) users

This answer relates to Local Network Sharing of the Public folder within each users "Home" folder, /home/$USER/Public. When one right clicks on this folder and selects Local Network Share One would see this window:

enter image description here

1. First time sharing in this computer

If no one else has ever shared a "Public" folder in this computer, samba will not be installed. The user will see:

enter image description here

On clicking Install Service one gets the prompt to install samba:

enter image description here

This is the first hurdle for the standard user. On clicking install, the user will be prompted to the administrator's password. At this point the administrator can take over and enter the password.

Alternately if the Administrator has already installed samba the standard user will not see these prompts.

2. The user is not a member of sambashare group

When samba is installed in the computer the standard user will see the following error message when they try to enable folder sharing.

enter image description here

The key to this error is the last bit, "You do not have permission to create a usershare. Ask your administrator to grant you permissions to create a share."

To share a folder (Public or any other) the standard user has to be a member of the sambashare group. This has to be done by the administrator (someone with sudo privileges). Log out as the standard user and log back in as the administrator. Open a terminal and enter the command:

sudo gpasswd -a johndoe sambashare

where johndoe is to be replaced by the user name of the standard user trying to share the Public folder.

Note: the command is gpasswd emphasis on the g . This command will not change the passoword of the user johndoe. This command will add johndoe to the group sambashare.

Next time the standard user logs in, they will almost be able to share the Public folder.

Note2: If the second user is also an administrator (not a standard user) then that user can use the sudo gpasswd command to add themselves to the group. However, the command will not take effect until the user logs out and logs back in.

3. The sambashare "Public" already exists!

When the standard user logs in and tries again they will see a slightly different error message:

enter image description here

If the standard user gets this error, it means another user (may be the administrator) in this computer has already shared their "Public" folder and used the default share name.

The solution is simple. The standard user needs to change the name of the sambashare in the dialog box like so:

enter image description here

Give an unique share name specific to each standard user, so that when someone accesses the "Public" shared folder they know whose "Public" folder they are accessing.

Hope this helps