2

I installed Ubuntu 19.10 a short time ago. One of the way I would like to use it is as a file server. Using the Gnome GUI, I enabled sharing on a folder called UbuntuShare and clicked through the prompts to enable Samba. I've checked the boxes so that that anyone can access the shares and set the permission to read/write for all as well.

A few odd things have happened with this.

  1. In the UbuntuShare folder, a file called core has been created. It has an orange lock symbol and red X symbol on it. This happened with another shared folder. I wound up deleting the folder to get rid of it, but it happened again with this folder. I've searched online and can't find anything on this so I don't know if this is normal, but it seems odd.

  2. I can see and access the UbuntuShare folder from my Windows 10 laptop, but only if I type in the computer name or IP address. It does not show up on the network sharing screen. What's very odd is that I have two other desktops and neither of them can see it, even if I type in the computer name or IP address. All three machines are Windows 10 and I have checked the network sharing settings on all three, and they are the same. The only difference is that my laptop is on a domain from my office, while the desktops are on the standard Workgroup.

  3. I created and save a couple of Word documents from my laptop to the Samba share on Ubuntu. When I am on the Ubuntu machine, it has a lock symbol on them. When I look at permissions in the GUI, it says I do not own the files and cannot modify the permissions. How to I make it so I don't have this issue with filed added by the windows machines?

I am concerned that I have messed up Samba somehow. Before I realized that the Gnome GUI had a way to share, I was following some command line instructions I found to install Samba for an earlier version of Ubuntu. Once I realized that the GUI was simpler, I did sudo apt purge on Samba to erase whatever I had done, hoping that would clear it out.

My goal is to make the share work so I can easily share files for the Windows machines to access. The two windows 10 machines are used by my elementary school children, so I don't want to get into having to authenticate to get to the Samba server. Also, if the core file is normal, then that is fine. If not, I'd like to fix it.

I would appreciate any help with this.

Erik

3
  • 1
    Ubuntu 9.10 or 19.10? Please advise.
    – K7AAY
    Mar 23, 2020 at 23:06
  • Ubuntu 9.10 means the 2009.October release (format is yy.mm for releases), which is really OLD/ancient... 19.10 means the 2019-October release. A lot has happened since 2009.October (eg. wannacry) thus SAMBA has changed since then; it didn't impact GNU/Linux, but changes made by microsoft to protect windows mandated changes in GNU/Linux releases as well)
    – guiverc
    Mar 23, 2020 at 23:42
  • Sorry guys! Long day. I mean 19.10 - the most recent one. Updated the main question to fix the typo.
    – Marsonis
    Mar 24, 2020 at 0:14

7 Answers 7

1
  • To check the content of odd folder and have ability to remove it, use terminal.
  • In terminal window go to your folder using a cd command: cd /home/$USER/UbuntuShare
  • Check this odd file's owner and permissions by ls -ailh command

If you really want to remove that file, you could use sudo rm -fr /pathto/UbuntuShare/core

But it is better to examine what is inside of it by sudo cat /home/$USER/UbuntuShare/core.

In your case you've shared a default smb.conf file without share configured. To configure it add the next to the end of your /etc/samba/smb.conf:

[SambaShare]
   # replace yourusername by your real user's name
   path = /home/yourusername/UbuntuShare
   writable = yes
   guest ok = yes
   guest only = yes
   read only = no
   create mode = 0777
   directory mode = 0777
   force user = nobody

Also make sure your folder have required rights and ownership:

sudo chown -R nobody:nogroup /home/$USER/UbuntuShare
sudo chmod -R 0777 /home/$USER/UbuntuShare

Then restart samba services:

sudo systemctl restart smbd nmbd

Also, allow samba in firewall:

sudo ufw allow samba

Update 1:

With Windows 10 version 1511, support for SMBv1 and thus NetBIOS device discovery was disabled by default. Depending on the actual edition, later versions of Windows starting from version 1709 ("Fall Creators Update") do not allow the installation of the SMBv1 client anymore. This causes hosts running Samba not to be listed in the Explorer's "Network (Neighborhood)" views. While there is no connectivity problem and Samba will still run fine, users might want to have their Samba hosts to be listed by Windows automatically.

Making samba on Ubuntu 18.04, 19.10 working and be visible in Windows 10 Version 1909 shared network using wsdd

Do the next using a terminal:

  • cd ~/
  • sudo apt install git
  • git clone https://github.com/christgau/wsdd
  • cd wsdd
  • sudo cp etc/systemd/wsdd.service /etc/systemd/system/
  • sudo cp src/wsdd.py /usr/bin/wsdd
  • sudo nano /etc/systemd/system/wsdd.service

    Change:
    Group=nobody to Group=nogroup

    Add above ExecStart:
    Restart=on-failure
    RestartSec=15

    And exit by hitting:Ctrl+X, then Y, then Enter

  • sudo ufw allow 3702 && sudo ufw allow 5357 # allow wsdd traffic pass through firewall

  • sudo systemctl enable wsdd.service
  • sudo systemctl start wsdd
  • systemctl status wsdd to see if it is active

enter image description here

If service is active, remove wsdd folder: rm -fr ~/wsdd

Also, if you do not want to bother yourself with this configuration and if your Ubuntu machine visibility in Windows 10 Shared Network is not critical, you could just drug&drop your UbuntuShare folder in windows file explorer to Quick access item making its shortcut there. So you could access it without input your Ubuntu machine's IP address.

Update 2: If windows 10 refuses to connect to your Ubuntu share, try to specify SMB protocol to version 2 or 3:

  • Open for edit your smb.conf file: sudo nano /etc/samba/smb.conf
  • Under [global] section input the next: protocol = SMB3 if your samba --version is 4.
  • Restart samba services: sudo systemctl restart smbd nmbd
  • Check if your samba services are healthy: systemctl status smbd nmbd
1
  • Comments are not for extended discussion; this conversation has been moved to chat.
    – Mitch
    Mar 26, 2020 at 0:42
1

Thank you everyone for the guidance and help. After it became apparent that it was unlikely this was a samba issue, I spent some time today searching for possible causes in Windows.

I ran across the article below, followed the solution, and both desktop computers were immediately able to access the samba share.

Article with Solution: https://superuser.com/questions/1287731/windows-10-can-ping-other-pc-but-cannot-access-shared-folders-what-gives

Microsoft Support Article solution is based upon: https://support.microsoft.com/en-us/help/4046019

Computer configuration\administrative templates\network\Lanman Workstation "Enable insecure guest logons"

0
0

I could not try it now on Windows, but it works from ubuntu at least. This is a config I've taken from here and I think it worth of try:

  • Backup your current /etc/samba/smb.conf file by copying it: sudo cp /etc/samba/smb.conf /etc/samba/bk.smb.conf
  • Edit your /etc/samba/smb.conf:

    [global]
        workgroup = WORKGROUP
        server string = %h server (Samba, Ubuntu)
        netbios name = UBUNTU-POWERSPEC
        log file = /var/log/samba/log.%m
        max log size = 10240
        security = user
        map to guest = Bad Password
        getwd cache = yes
        guest account = nobody
        usershare allow guests = Yes
        server signing = auto
        passdb backend = tdbsam
        local master = yes
    
        vfs objects = acl_xattr
        map acl inherit = yes
        store dos attributes = yes
    
        winbind nss info = template
        winbind enum users = Yes
        winbind enum groups = Yes
        winbind use default domain = yes
    
        client use spnego = yes
        client ntlmv2 auth = yes
    
        encrypt passwords = yes
    
        local master = No
        hide dot files = No
        allow insecure wide links = yes
        store dos attributes = yes
    
  • Restart samba services:

    sudo systemctl restart smbd nmbd
    
  • Check samba services statuses:

    sudo systemctl status smbd nmbd
    
2
  • Thanks. Tried this and it did not make a change to the Win10 desktops. It did make samba unaccessable from my laptop, so I reverted the changes.
    – Marsonis
    Mar 26, 2020 at 1:18
  • 1
    Busy couple of days. Version is 1909, OS Build is 18363.752. Ran Windows update to fully update all machines. Same result - Surfacebook has no problem with access. Two Win10 desktops can see Ubuntu in network, but get the same error message as before.
    – Marsonis
    Mar 28, 2020 at 3:26
0

One more smb.conf configuration I tried and it seems working in my windows 10 VM you could try:

[global]
  server max protocol = SMB3
  encrypt passwords = yes
  dns proxy = no
  strict locking = no
  oplocks = yes                                                                                                                   
  deadtime = 15
  max log size = 51200
  max open files = 933761
  logging = file
  load printers = no
  getwd cache = yes
  guest account = nobody
  map to guest = Bad User
  obey pam restrictions = yes
  directory name cache size = 0
  kernel change notify = no
  panic action = /usr/share/samba/panic-action %d
  server string = Media Server
  ea support = yes
  store dos attributes = yes
  lm announce = yes
  hostname lookups = yes
  time server = yes
  acl allow execute always = true
  dos filemode = yes
  multicast dns register = yes
  domain logons = no
  local master = yes
  server role = standalone
  netbios name = Ubuntu
  workgroup = WORKGROUP
  security = user
  create mask = 0666
  directory mask = 0777
  client ntlmv2 auth = yes
  unix charset = UTF-8       
  log level = 1

[sambashare]
  path = /home/spacer/sambashare
  comment = sambashare on Ubuntu
  directory mask = 0755
  create mode = 0777
  read only = no
  available = yes
  browseable = yes
  writable = yes
  guest ok = yes
  public = yes
  locking = no
  strict locking = no

Do not remember to have your currently working smb.conf file backed up and restart samba services.

0

Follow these instructions. For maximum usability make sure the SAMBA account username (separate from server username) on the server matches that of the Windows account you're using to access the share.

0

It's getting crowded in here ....

There are 4 ways a Win10 machine can access an Ubuntu Samba server:

[1] By ip address = the "cleanest" way since it doesn't rely on any intermediate protocol. You would need to set a static ip address on the server or use your router to do that and you would need to access the server explicitly \\192.168.0.100

[2] Multicast = Used in home networks mostly. There are two variant's:

** WS-Discovery = This is what Win10 uses to discover and connect to other WIn10 machines, certain NAS like Synology, and Ubuntu if you set it up properly. Then Explorer should discover and connect to your machine.

** mDNS = Called Avahi ( Linux ) or Bonjour ( MacOS ). Although Win10 can access a Samba server that way it must be done explicitly \\linux-host-name.local - but it cannot discover it that way.

[3] NetBIOS = The scourge of Samba for decades. WIn10 by default cannot discover hosts this way because it disabled SMBv1 on the client side. You can re-enable it if you want but in your case it wouldn't work anyway because your Linux host name ( from which the NetBIOS name is derived ) is too long: UBUNTU-POWERSPEC

It can only be 15 characters or less in length. You can fix that in smb.conf itself if you want by adding right under the workgroup = WORKGROUP line it's new name - for example:

netbios name = ubuntu-powerspc

Then restart smbd and nmbd in that order.

NetBIOS is a flaky thing that Microsoft first tried to get rid of 20 years ago in Win2000 so you may need to reboot all if your machines in order for the new name to be registered.

I personally would go with ip address, mDNS, or WSD in that order.

Side note: "Error was Path not allowed" - I suspect you are trying to share something under /media/erik. A guest share under that folder may be visible to the client because samba defined it but is inaccessible to everyone but erik because of the Linux permissions of /media/erik by default. One way to fix it is to force the guest to appear as erik. Under workgroup = WORKGROUP add the following:

force user = erik

Then restart smbd.

0

If smb.conf file modifications have no effect, then most probably the issue is on those two windows 10 machines side. It seems right even because of the fact that the one machine with windows 10 is able to connect to your Ubuntu share. It most probably means that nor firewall and nor samba services reject connections. But because of there are many different SMB2 and SMB3 protocol versions exist, windows could restrict connections to services, that does not satisfy its current SMB2 or SMB3 protocol versions.

To be sure, check if SMB2 protocol is enabled on your windows 10 machines by PowerShell command execution, running PowerShell as Administrator:

Get-SmbServerConfiguration | Select EnableSMB2Protocol

End enable it if it is disabled:

Set-SmbServerConfiguration -EnableSMB2Protocol $true

The same way you could check SMB3 protocol version:

Get-SmbServerConfiguration | Select EnableSMB3Protocol

For testing purposes, you could disable SMB3 protocol for a moment to check if the newest SMB3 protocol version is the cause:

Set-SmbServerConfiguration -EnableSMB3Protocol $false

Then enable it again after checking:

Set-SmbServerConfiguration -EnableSMB3Protocol $true

At the end, try also additionally specifying the next in smb.conf:

[global]
  server min protocol = SMB2_10
  client max protocol = SMB3
  client min protocol = SMB2_10

But comment it if it does not help.

And try also connecting using full path:

//ubuntu_IP_address/UbuntuShare
1
  • Thanks! I tried this and it did not resolve the issue. After some searching today, I was able to find an article and MS Support article that solved the issue. I've posted it as an answer so hopefully it can help anyone else who is dealing with this. Thank you so much for all of your help!
    – Marsonis
    Mar 29, 2020 at 0:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .