System: Debian 11, fully updated, samba server, smbclient, etc. all installed.
Can't create shared folder from Nautilus. Error message:
"net usershare' returned error 255: net usershare: cannot open usershare directory /var/lib/samba/usershares. Error Permission denied
You do not have permission to create a usershare. Ask your administrator to grant you permissions to create a share"
Any suggestions?
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Can't create shared folder in Nautilus
-
- Posts: 241
- Joined: 2021-04-06 22:14
- Location: Sweden / Linköping
- Has thanked: 7 times
- Been thanked: 9 times
Re: Can't create shared folder in Nautilus
Hi
I have discovered that you need to run Nautilus/Caja/Nemo as root to get permission to share folders in Debian
I have discovered that you need to run Nautilus/Caja/Nemo as root to get permission to share folders in Debian
Why make things complicated in life, if you can make it easier for yourself... Do it. ;o)
You only have one life, so make the most of it and enjoy it while you can.
You only have one life, so make the most of it and enjoy it while you can.
-
- df -h | grep > 20TiB
- Posts: 1418
- Joined: 2012-10-06 05:31
- Location: /dev/chair
- Has thanked: 79 times
- Been thanked: 189 times
Re: Can't create shared folder in Nautilus
No, no you do not. Running GUI applications as root unnecessarily is extremely bad advice, and it's almost always unnecessary. If you need to grant permissions on a resource to some user(s) you use groups, that's what they're for...Marie SWE wrote:Hi
I have discovered that you need to run Nautilus/Caja/Nemo as root to get permission to share folders in Debian
Or you use PAM/polkit/whatever newfangled overcomplicated *kit garbage you desire, but I digress
I don't know how much (if any) of this is already set up by default on Debian since I don't run it on my desktop these days (so you may encounter "already exists" type errors below), but the general procedure to get the new(ish) usershares thing working is:pwzhangzz wrote:Any suggestions?
Add:
Code: Select all
usershare allow guests = true
usershare max shares = 5
usershare owner only = true
usershare path = /var/lib/samba/usershares
Create a group to which users allowed to create shares will belong, IIRC the usual name is "sambashare".
Code: Select all
# groupadd sambashare
Code: Select all
# mkdir -p /var/lib/samba/usershares
# chown root.sambashare /var/lib/samba/usershares
# chmod 1770 /var/lib/samba/usershares
Code: Select all
# gpasswd -a [username] sambashare
Considering many file managers moved to usershares a while back, it's a shame there's no Debian wiki page explaining exactly how to do this...
Ed. If you must have pictures (and run KDE), this looks to be pretty well correct. And apparently directories, groups and permissions are already set up in Debian, so you just need the smb.conf edits and to add your user to the group.
Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.
Re: Can't create shared folder in Nautilus
Looks like the new smb.conf works! No need to run Nautilus as root. Will try to run it again in a different installation to make sure it actually works.
Re: Can't create shared folder in Nautilus
Thanks! Will change back to the default/original smb.conf and try your suggestions.steve_v wrote:Marie SWE wrote:HiI don't know how much (if any) of this is already set up by default on Debian since I don't run it on my desktop these days (so you may encounter "already exists" type errors below), but the general procedure to get the new(ish) usershares thing working is:pwzhangzz wrote:Any suggestions?
Add:to /etc/samba/smb.conf (season to taste), and restart samba however you restart stuff with systemd(isaster).Code: Select all
usershare allow guests = true usershare max shares = 5 usershare owner only = true usershare path = /var/lib/samba/usershares
Create a group to which users allowed to create shares will belong, IIRC the usual name is "sambashare".Create the aforementioned (/var/lib/samba/usershares) directory, owned by the above group and with the sticky bit set (i.e. permission bits 1770).Code: Select all
# groupadd sambashare
Add your unprivileged user to the group and logout/login.Code: Select all
# mkdir -p /var/lib/samba/usershares # chown root.sambashare /var/lib/samba/usershares # chmod 1770 /var/lib/samba/usershares
Note that as samba stores users in a separate and incompatible (windows-style) database, to create shares that require authentication you will likely need to use smbpasswd to add an entry for your user as well. Usage is in the manual.Code: Select all
# gpasswd -a [username] sambashare
Considering many file managers moved to usershares a while back, it's a shame there's no Debian wiki page explaining exactly how to do this...
Ed. If you must have pictures (and run KDE), this looks to be pretty well correct. And apparently directories, groups and permissions are already set up in Debian, so you just need the smb.conf edits and to add your user to the group.