I was using my old laptop as a NAS and print server using Samba. It worked fine before and I can access the share just fine but after an update my Samba share doesn’t work anymore and keep giving this error “net usershare add: failed to add share nas. Error was Operation not permitted”.
Here is my smb.conf if it will help
# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it.
#
# Note:
# SMB1 is disabled by default. This means clients without support for SMB2 or
# SMB3 are no longer able to connect to smbd (by default).
[global]
workgroup = SAMBA
security = user
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw
# Install samba-usershares package for support
include = /etc/samba/usershares.conf
usershare owner only = false
[homes]
comment = Home Directories
valid users = sanc
read only = No
inherit acls = Yes
[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = Yes
[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
# printadmin is a local group
write list = printadmin root
force group = printadmin
create mask = 0664
directory mask = 0775
[NAS]
path = /mnt/NAS
browseable = yes
writable = yes
guest ok = yes
read only = No
valid users = sanc
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Weak crypto is allowed by GnuTLS (e.g. NTLM as a compatibility fallback)
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
I also figured out that when I use the command sudo net usershare list it still remembers the my old share
sanc@fedora ~> sudo net usershare list
[sudo] password for sanc:
nas
Steam Games
but when I don’t use sudo it outputs nothing
and I can share folders from my main drive too but not folders from my second drive that I actually use as NAS
Update: I noticed that the NAS fileshare is actually still accessible from Windows but I just can’t seem to edit the share on Linux using GUI and have to use sudo and edit the share using terminal. The shares I have won’t show up in info center as well
Sorry I don’t really understand what do you mean by mounting from Windows but I do map the NAS on my Windows using the “Map network drive” option.
I mount the second drive using the /etc/fstab method. The one where I just make a directory named NAS on the /mnt/ directory and then edit my /etc/fstab file by adding a new line containing UUID=cd2de557-dad3-4be4-a9c1-f85873a67c38 /mnt/NAS btrfs defaults,noatime 0 0
The net use command js gives error
sanc@fedora ~> net use
Invalid command: net use
Usage:
net rpc Run functions using RPC transport
net rap Run functions using RAP transport
net ads Run functions using ADS transport
net file Functions on remote opened files
net share Functions on shares
net session Manage sessions
net server List servers in workgroup
net domain List domains/workgroups on network
net printq Modify printer queue
net user Manage users
net group Manage groups
net groupmap Manage group mappings
net sam Functions on the SAM database
net validate Validate username and password
net groupmember Modify group memberships
net admin Execute remote command on a remote OS/2 server
net service List/modify running services
net password Change user password on target server
net primarytrust Run functions related to the primary workstation trust.
net changetrustpw Change the trust password
net changesecretpw Change the secret password
net setauthuser Set the winbind auth user
net getauthuser Get the winbind auth user settings
net time Show/set time
net lookup Look up host names/IP addresses
net g_lock Manipulate the global lock table
net join Join a domain/AD
net offlinejoin Perform offline domain join
net dom Join/unjoin (remote) machines to/from a domain/AD
net cache Operate on the cache tdb file
net getlocalsid Get the SID for the local domain
net setlocalsid Set the SID for the local domain
net setdomainsid Set domain SID on member servers
net getdomainsid Get domain SID on member servers
net maxrid Display the maximum RID currently used
net idmap IDmap functions
net status Display server status
net usershare Manage user-modifiable shares
net usersidlist Display list of all users with SID
net conf Manage Samba registry based configuration
net registry Manage the Samba registry
net eventlog Process Win32 *.evt eventlog files
net printing Process tdb printer files
net serverid Manage the serverid tdb
net notify notifyd client code
net tdb Show information from tdb records
net vfs Filesystem operation through the VFS stack
net witness Manage witness registrations
net help Print usage information
I already tried to disable SELinux and use net usershare add again but it still doesn’t work and gives the same error
Oh sorry I don’t really use Windows terminal but to answer your question yes net use does work and I can indeed map the share from Windows. But the share just won’t show up in Info Center in Fedora which is why I tried to add the share again using net usershare add but it ended up giving the error “net usershare add: failed to add share nas. Error was Operation not permitted”. But I’ve noticed that it only happens when I’m trying to share a folder on my second drive or the drive I’m using as the NAS. The drive is mounted fine tho and I can access it just fine from Dolphin or terminal on /mnt/NAS so yeah the user on Fedora that I use to login the share have access to files on the /mnt/NAS. .
sanc@fedora /mnt> ls -l
total 16
drwxrwxrwx. 1 sanc sanc 66 Jan 31 20:37 NAS/
You didn’t include the “dump of your service definitions” which was the important part.
“Operation not permitted” generally implies a permissions problem.
All that said, you haven’t provided enough information to identify what the issue might be.
How, exactly, can you reproduce this problem? Which computer (Is it a Windows system, a Linux system, the Linux system used as a NAS?) is unable to access this share?
Please also provide the following:
output of ls -lRa /mnt/nas
Attempt a connection to the share with:
smbclient //server/sharename -d5 -U <userid you normally used to access the share>
Enter your password when prompted and, if you successfully log in, type dir, then use the get command to retrieve a file.
I understand if you wish to keep the contents of your NAS private. And the name/content doesn’t really matter for this exercise. Rather, want to know everything else about the files and folders in your share (permissions. ownership. directory structure, etc.)
Please post the output of the smbclient commands as well (the command line I provided enables debugging so lots of additional information should be provided. Again, the names of the files/folders aren’t important, but all the rest of the information is.
The dump of my service definition just contains the content of my smb.conf. I am pretty sure it is a permission issue since I can share folders on my main drive(the drive I use for Fedora) just fine. Issue only happens when I try to share a folder located on my second drive or my /mnt/nas
You can reproduce the problem by using Fedora and have a second drive that you mounted using /etc/fstab method then try to share it using net usershare add nas /mnt/nas.
This is the output of ls -lRa
sanc@fedora ~> ls -lRa /mnt/NAS
/mnt/NAS:
total 16
drwxr-xr-x. 1 sanc sanc 66 Feb 2 00:21 ./
drwxr-xr-x. 1 root root 6 Jan 24 13:52 ../
drwxrwxrwx. 1 sanc sanc 0 Jan 14 18:00 Assets/
drwxrwxrwx. 1 sanc sanc 0 Jan 14 18:00 Audio/
drwxrwxrwx. 1 sanc sanc 12 Jan 24 16:53 Pictures/
drwxrwxrwx. 1 sanc sanc 0 Jan 14 17:59 Projects/
drwxrwxrwx. 1 sanc sanc 18 Jan 24 16:52 Videos/
/mnt/NAS/Assets:
total 16
drwxrwxrwx. 1 sanc sanc 0 Jan 14 18:00 ./
drwxr-xr-x. 1 sanc sanc 66 Feb 2 00:21 ../
/mnt/NAS/Audio:
total 16
drwxrwxrwx. 1 sanc sanc 0 Jan 14 18:00 ./
drwxr-xr-x. 1 sanc sanc 66 Feb 2 00:21 ../
/mnt/NAS/Pictures:
total 16
drwxrwxrwx. 1 sanc sanc 12 Jan 24 16:53 ./
drwxr-xr-x. 1 sanc sanc 66 Feb 2 00:21 ../
drwxrwxrwx. 1 sanc sanc 872 Jan 24 16:53 NONAND/
/mnt/NAS/Pictures/NONAND:
total 11536
drwxrwxrwx. 1 sanc sanc 872 Jan 24 16:53 ./
drwxrwxrwx. 1 sanc sanc 12 Jan 24 16:53 ../
-rwxrwxrwx. 1 sanc sanc 267201 Aug 5 20:30 20250805203031_1.jpg*
-rwxrwxrwx. 1 sanc sanc 365073 Aug 5 20:30 20250805203043_1.jpg*
-rwxrwxrwx. 1 sanc sanc 280044 Aug 5 20:30 20250805203059_1.jpg*
-rwxrwxrwx. 1 sanc sanc 471402 Aug 5 20:31 20250805203113_1.jpg*
-rwxrwxrwx. 1 sanc sanc 428934 Aug 5 20:31 20250805203116_1.jpg*
-rwxrwxrwx. 1 sanc sanc 420640 Jan 24 12:34 3942480_10.jpg*
-rwxrwxrwx. 1 sanc sanc 424631 Jan 24 16:50 3942480_13.jpg*
-rwxrwxrwx. 1 sanc sanc 699928 Jan 24 14:13 3942480_1.jpg*
-rwxrwxrwx. 1 sanc sanc 389547 Jan 23 14:22 3942480_3.jpg*
-rwxrwxrwx. 1 sanc sanc 395887 Jan 19 22:37 3942480_8.jpg*
-rwxrwxrwx. 1 sanc sanc 477178 Jan 24 11:57 3942480_9.jpg*
-rwxrwxrwx. 1 sanc sanc 387360 Jan 24 14:17 3942480.jpg*
-rwxrwxrwx. 1 sanc sanc 583144 Jan 24 14:20 3942480_screenshots_20260119080815_1.jpg*
-rwxrwxrwx. 1 sanc sanc 370785 Jan 24 14:18 3942480_screenshots_20260119200504_1.jpg*
-rwxrwxrwx. 1 sanc sanc 464208 Jan 24 14:19 3942480_screenshots_20260119200651_1.jpg*
-rwxrwxrwx. 1 sanc sanc 555012 Jan 24 14:20 3942480_screenshots_20260119214155_1.jpg*
-rwxrwxrwx. 1 sanc sanc 237080 Jan 24 14:20 3942480_screenshots_20260119220732_1.jpg*
-rwxrwxrwx. 1 sanc sanc 4245209 Dec 22 17:11 jirai-kei.png*
-rwxrwxrwx. 1 sanc sanc 310312 Jul 28 2025 'The existenceN of you AND me.jpg'*
/mnt/NAS/Projects:
total 16
drwxrwxrwx. 1 sanc sanc 0 Jan 14 17:59 ./
drwxr-xr-x. 1 sanc sanc 66 Feb 2 00:21 ../
/mnt/NAS/Videos:
total 16
drwxrwxrwx. 1 sanc sanc 18 Jan 24 16:52 ./
drwxr-xr-x. 1 sanc sanc 66 Feb 2 00:21 ../
drwxrwxrwx. 1 sanc sanc 236 Feb 2 00:21 Wallpaper/
/mnt/NAS/Videos/Wallpaper:
total 1211344
drwxrwxrwx. 1 sanc sanc 236 Feb 2 00:21 ./
drwxrwxrwx. 1 sanc sanc 18 Jan 24 16:52 ../
-rwxrwxrwx. 1 sanc sanc 68961359 Aug 31 12:32 'Just Lilith.mov'*
-rwxr--r--. 1 sanc sanc 617790692 Feb 1 01:04 'new lilith title animation with music.mp4'*
-rwxr--r--. 1 sanc sanc 498989360 Feb 2 00:20 Output.mp4*
-rwxrwxrwx. 1 sanc sanc 54668023 Aug 6 00:35 'The NOexistenceN of you AND me - Concert Song JP.mp4'*
and this is the output of smbclient //server/sharename -d5 -U <userid you normally used to access the share>
sanc@fedora ~> ls -lRa /mnt/NAS
/mnt/NAS:
total 16
drwxr-xr-x. 1 sanc sanc 66 Feb 2 00:21 ./
drwxr-xr-x. 1 root root 6 Jan 24 13:52 ../
drwxrwxrwx. 1 sanc sanc 0 Jan 14 18:00 Assets/
drwxrwxrwx. 1 sanc sanc 0 Jan 14 18:00 Audio/
drwxrwxrwx. 1 sanc sanc 12 Jan 24 16:53 Pictures/
drwxrwxrwx. 1 sanc sanc 0 Jan 14 17:59 Projects/
drwxrwxrwx. 1 sanc sanc 18 Jan 24 16:52 Videos/
/mnt/NAS/Assets:
total 16
drwxrwxrwx. 1 sanc sanc 0 Jan 14 18:00 ./
drwxr-xr-x. 1 sanc sanc 66 Feb 2 00:21 ../
/mnt/NAS/Audio:
total 16
drwxrwxrwx. 1 sanc sanc 0 Jan 14 18:00 ./
drwxr-xr-x. 1 sanc sanc 66 Feb 2 00:21 ../
/mnt/NAS/Pictures:
total 16
drwxrwxrwx. 1 sanc sanc 12 Jan 24 16:53 ./
drwxr-xr-x. 1 sanc sanc 66 Feb 2 00:21 ../
drwxrwxrwx. 1 sanc sanc 872 Jan 24 16:53 NONAND/
/mnt/NAS/Pictures/NONAND:
total 11536
drwxrwxrwx. 1 sanc sanc 872 Jan 24 16:53 ./
drwxrwxrwx. 1 sanc sanc 12 Jan 24 16:53 ../
-rwxrwxrwx. 1 sanc sanc 267201 Aug 5 20:30 20250805203031_1.jpg*
-rwxrwxrwx. 1 sanc sanc 365073 Aug 5 20:30 20250805203043_1.jpg*
-rwxrwxrwx. 1 sanc sanc 280044 Aug 5 20:30 20250805203059_1.jpg*
-rwxrwxrwx. 1 sanc sanc 471402 Aug 5 20:31 20250805203113_1.jpg*
-rwxrwxrwx. 1 sanc sanc 428934 Aug 5 20:31 20250805203116_1.jpg*
-rwxrwxrwx. 1 sanc sanc 420640 Jan 24 12:34 3942480_10.jpg*
-rwxrwxrwx. 1 sanc sanc 424631 Jan 24 16:50 3942480_13.jpg*
-rwxrwxrwx. 1 sanc sanc 699928 Jan 24 14:13 3942480_1.jpg*
-rwxrwxrwx. 1 sanc sanc 389547 Jan 23 14:22 3942480_3.jpg*
-rwxrwxrwx. 1 sanc sanc 395887 Jan 19 22:37 3942480_8.jpg*
-rwxrwxrwx. 1 sanc sanc 477178 Jan 24 11:57 3942480_9.jpg*
-rwxrwxrwx. 1 sanc sanc 387360 Jan 24 14:17 3942480.jpg*
-rwxrwxrwx. 1 sanc sanc 583144 Jan 24 14:20 3942480_screenshots_20260119080815_1.jpg*
-rwxrwxrwx. 1 sanc sanc 370785 Jan 24 14:18 3942480_screenshots_20260119200504_1.jpg*
-rwxrwxrwx. 1 sanc sanc 464208 Jan 24 14:19 3942480_screenshots_20260119200651_1.jpg*
-rwxrwxrwx. 1 sanc sanc 555012 Jan 24 14:20 3942480_screenshots_20260119214155_1.jpg*
-rwxrwxrwx. 1 sanc sanc 237080 Jan 24 14:20 3942480_screenshots_20260119220732_1.jpg*
-rwxrwxrwx. 1 sanc sanc 4245209 Dec 22 17:11 jirai-kei.png*
-rwxrwxrwx. 1 sanc sanc 310312 Jul 28 2025 'The existenceN of you AND me.jpg'*
/mnt/NAS/Projects:
total 16
drwxrwxrwx. 1 sanc sanc 0 Jan 14 17:59 ./
drwxr-xr-x. 1 sanc sanc 66 Feb 2 00:21 ../
/mnt/NAS/Videos:
total 16
drwxrwxrwx. 1 sanc sanc 18 Jan 24 16:52 ./
drwxr-xr-x. 1 sanc sanc 66 Feb 2 00:21 ../
drwxrwxrwx. 1 sanc sanc 236 Feb 2 00:21 Wallpaper/
/mnt/NAS/Videos/Wallpaper:
total 1211344
drwxrwxrwx. 1 sanc sanc 236 Feb 2 00:21 ./
drwxrwxrwx. 1 sanc sanc 18 Jan 24 16:52 ../
-rwxrwxrwx. 1 sanc sanc 68961359 Aug 31 12:32 'Just Lilith.mov'*
-rwxr--r--. 1 sanc sanc 617790692 Feb 1 01:04 'new lilith title animation with music.mp4'*
-rwxr--r--. 1 sanc sanc 498989360 Feb 2 00:20 Output.mp4*
-rwxrwxrwx. 1 sanc sanc 54668023 Aug 6 00:35 'The NOexistenceN of you AND me - Concert Song JP.mp4'*