Score:0

can't connect to samba share folder from ubuntu to windows

ag flag

I want to create a share folder from my ubuntu server to all my devices that are on the local network, I've created a folder in this directory /home/my_user_name/Library. then I run chmod 777 Library to get access for all users, finally I've add to the smb.conf the following lines:

[Library]
    path = /home/my_user_folder/Library
    read only = no
    guest ok = yes
    guest only = yes

then I've run:

sudo service smbd restart

then I've tried to access from my windows machine, I can see the shared folder but when I'm clicking the folder I have a pop up message Link

how I can get it to work?

also I've tried to access from my phone and I don't have permission

Edward Markham avatar
gh flag
Looks like there are some good diagnostics in this web page. try those. http://linux-training.be/networking/ch16.html
A1 Computers avatar
cn flag
Is windows network connection on the private or public mode?
Levente avatar
cn flag
@A1Computers wants to know the following: "Is the Windows network connection on the private or public mode?" (you can verify that in a _Powershell_ window by executing the following command: `Get-NetConnectionProfile`)
guiverc avatar
cn flag
Without release details, possible answers maybe incomplete or not work in your environment. Changes have occurred over time, thus there are differences in releases, so as you've not provided any release details - you'll need to adjust for your system yourself according to it's version.
Daniel Kalfa avatar
ag flag
I'm using Jammy release, my windows machine network connection is public, I can see the network but when I'm trying to coonnect it says i don't have permission
Score:0
tr flag

Can you ping your server from your windows client?

Please run the following commands and paste the results-

ip -br a
sudo ufw status numbered

this is to verify if a) your local ip is correct b) your firewall is open to the samba ports windows is looking for

if the firewall is enabled, but Samba isn't on the list, try

sudo ufw allow Samba

This will open up the correct ports through your firewall. Verify by running

sudo ufw status numbered

This will list all the current rules. Then you can delete specific rules by entering the rule number. for example:

sudo ufw delete 1

Let me know if this works

Daniel Kalfa avatar
ag flag
when I'm running `sudo ufw status numbered` I get `Status: inactive`, and when I'm tring to add the rule with `sudo ufw allow Samba` I'm getting: `Skipping adding existing rule Skipping adding existing rule (v6)`
Score:0
es flag

Change your share definition to this:

[Library]
    path = /home/my_user_name/Library
    read only = no
    guest ok = yes
    force user = my_user_name

Change my_user_name to an actual user name.

Then restart smbd:

sudo service smbd restart

Don't have all the information necessary on how you are set up but it may be because you are using Ubuntu 22.04 or maybe your home directory is encrypted or ...

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.