Fail to share a folder [SOLVED]

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
nilli
Level 1
Level 1
Posts: 8
Joined: Tue Dec 10, 2019 4:26 am

Fail to share a folder [SOLVED]

Post by nilli »

Dear all,

wanted to share a folder.
Installed Nemo-share.
Clicked to share folder but got an error :

Code: Select all

>net usershare< returned the error 255 : 
net usershare add: cannot convert name 'Everyone' to a SID. 
The transportconnection attempt was refused by the remote system. 
Maybe smbd is not running.
But smbd and nmbd are running fine.

samba -i returns :

Code: Select all

pidfile_create: ERROR: Failed to create PID file /run/samba/samba.pid (Permission denied)
But the file /run/samba/samba.pid exists and contains the correct PID of smbd

I added : force group = +sambashare to /etc/samba/smb.conf but no effect.

/etc/samba/smb.conf :

Code: Select all

[global]

   workgroup = WORKGROUP
   netbios name = X270
   security = user
      
   client min protocol = NT1
   client max protocol = SMB2

   server min protocol = NT1
   server max protocol = SMB2
   
   force group = +sambashare
   hosts allow = 192.168.2. localhost
   interfaces = 192.168.2.0/24
   bind interfaces only = yes

   remote announce = 192.168.2.255
   remote browse sync = 192.168.2.255

   server role = standalone server
   obey pam restrictions = yes

   unix password sync = yes

   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

   pam password change = yes

   map to guest = bad user
   map to guest = Bad Password
   
[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700

[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no
   
   
What could I do ?

Thanks a lot !!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Kernel: 5.4.0-89-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 Desktop: Cinnamon 4.6.7
Distro: Linux Mint 20 Ulyana base: Ubuntu 20.04 focal
Type: Laptop System: LENOVO product: 20HN0012MX v: ThinkPad X270
JezekiljMonk
Level 3
Level 3
Posts: 106
Joined: Mon Dec 30, 2019 7:33 am
Contact:

Re: Fail to share a folder

Post by JezekiljMonk »

This is a lengthy tutorial but it might help.

viewtopic.php?f=42&t=353391&p=2042110#p2042110
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Re: Fail to share a folder

Post by altair4 »

What's all this about:
hosts allow = 192.168.2. localhost
interfaces = 192.168.2.0/24
bind interfaces only = yes

remote announce = 192.168.2.255
remote browse sync = 192.168.2.255
You realize that if you remove those lines and restart smbd sudo service smbd restart your error message will likely go away, right?

Don't understand this either:
client max protocol = SMB2
server max protocol = SMB2
Why limit yourself to SMB2? Without those lines samba defaults to SMB3.11 all by itself.

The other peculiarity is that you are using nautilus-share but you disabled the ability to create a guest share because you cut too much out of smb.conf.

My advice: Start over.

There should be a copy of the default smb.conf at /usr/share/samba/smb.conf

(1) Make a backup of your current smb.conf

Code: Select all

sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.bak
(2) Copy the default:

Code: Select all

sudo cp -a /usr/share/samba/smb.conf /etc/samba/
(3) add the client / server min of SMB1 to the [global] section if you need it to /etc/samba/smb.conf:

Code: Select all

client min protocol = NT1
server min protocol = NT1
(4) Then restart smbd: sudo service smbd restart
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
nilli
Level 1
Level 1
Posts: 8
Joined: Tue Dec 10, 2019 4:26 am

Re: Fail to share a folder

Post by nilli »

Hello Altair,

Yes, it works now. Thanks you very much !!

I feel so stupid and apologize for taking your time, I was trying to fix problems with hints from old posts, without really knowing what I was doing ... :roll:

... actually there was another problem before (which I solved meanwhile) which lead me to do all these changes in smb.conf , as I did not understand what was the real rootcause .. :?

Two thumbs up for your help !
Kernel: 5.4.0-89-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 Desktop: Cinnamon 4.6.7
Distro: Linux Mint 20 Ulyana base: Ubuntu 20.04 focal
Type: Laptop System: LENOVO product: 20HN0012MX v: ThinkPad X270
Locked

Return to “Networking”