Score:1

Ubuntu 23.04 Network File Sharing / Windows cannot access \\UBUNTU\Public

ag flag

I have a clean installation of Ubuntu 23.04 that I'm trying to configure to share the Public folder with a computer running Windows 10 Pro. The Windows computer is able to access shared folders from other computers on my network (Windows 7, Windows 10, Windows Server 2016/2019/2022).

I installed nautilus-share. After this, "Sharing Options" appeared in the menu. I tried the options Allow others to create and delete files in this folder and Guest access (for people without a user account). Neither made a difference.

This is the error that I'm getting on Windows.

Windows does not have read permission.

Here is the Sharing Options menu.

Here is net usershare info.

I am able to access the share on Ubuntu using "other locations".

I used smbpasswd to set the password.

I created a credential in Windows with the same username and password.

I searched and found quite a few posts about this problem, but no solutions that worked.

If anyone has any suggestions to fix this, I would really appreciate it.

(In case it matters, I am able to access files on the Windows and Windows Server computers from Ubuntu.)

Score:3
es flag

Edit /etc/samba/smb.conf and right under the workgroup = WORKGROUP line add this one:

force user = daryl

Then restart samba:

sudo service smbd restart

The problem isn't samba it's a change Ubuntu made from 22.04 on that changed the default permissions on a users home folder to 750 meaning no one other than that user can access any of it's contents.

"force user = daryl" will make the "guest" user appear to be you - for these shares.

bimmerdriver avatar
ag flag
Thank you very much for the help. Your suggestion fixed the problem.
Score:0
ag flag

I did another clean installation to make sure I could get file sharing from Ubuntu to Windows working properly from scratch.

Here are the steps I used from start to finish:

Install nautilus-share:

sudo apt-get update -y
sudo apt-get install -y nautilus-share

After restarting, the Sharing Options menu was available.

However, when I tried to create a share, there was an error:

'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.

Screen shot of error 255.

I found the fix for this error here: File sharing through samba is not working over LAN

sudo usermod -a -G sambashare $USER

After restarting, I was able to create a share.

To test that it was working, I used + Other Locations. It did not accept my credentials because the Samba password had not been set.

I found the fix for the problem here: Install and Configure Samba

sudo smbpasswd -a *username*

After restarting, I was able access the shared folder and see the contents on Ubuntu.

Now, I was at the point where I started this post, not being able to open the shared folder on Windows. After inserting force user = daryl in smb.conf, I was able to see the contents of the shared folder on Windows.

Score:0
bh flag

Thank you for the post and the answers provided.

In my case, after installed nautilus-share and set Samba password, shared the Public folder, all I had to do was opened port 445, the SMB port:

sudo ufw allow 445

I had an exact similar problem: I did a fresh installation of Ubuntu 23.04 Lunar Lobster.

Successfully installed nautilus-share, then shared the /home/behai/Public folder via Ubuntu 23.04 UI.

I then successfully set Samba password for behai, via:

sudo smbpasswd -a behai

Still, from Windows 10, it refused to connect to \hp-pavilion-15\Public, even though it asked for Samba password.

-- hp-pavilion-15 is my machine / host name.

I did get Windows to do diagnose, but for several hours, it gave me nothing. Finally, during one of those tries, it stated that it can see hp-pavilion-15 shared files and folders online, but port 445 refused connection.


Another point I have observed, ufw seems to be inactive by default? I did enable it and restart the Ubuntu, but port 445 never entered my mind -- I am not that familiar with Linux.

I hope this helps somebody else.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.