Score:0

Samba share, can't access

ua flag

Ubuntu Linux 22.04.2
Samba version 4.15.13-Ubuntu

I am using the default installation of Samba on Ubuntu.

I added this to /etc/samba/smb.conf

[www]
browseable = yes
printable = no
comment = Web Root Dir
create mode = 0644
directory mode = 0775
path = /var/www/html
writeable = yes
valid users = @www-data

Also there is this line active in the settings:

unix password sync = Yes

After this I restarted Samba as recommented.

systemctl status smbd

shows no errors. Samba is active (running)

I added myself to the www-data group before.

Now I tried to connect to the network share (\\<HOST>\www) from Windows with my Linux credentials. But I can't. The connection is refused.

/var/www/html is owned by www-data

ls -la /var/www/html

drwxrwxr-x  3 www-data www-data 4096 Apr 24 20:44 .
drwxr-xr-x  3 root root     4096 Apr 21 10:37 ..

What am I doing wrong? Am I missing any setting in Samba which isn't default?

I can access the host from windows and there is no firewall activated.

Score:0
ua flag

Ok. I realized that I have to use smbpasswd to somehow add the user to samba's own database.

sudo smbpasswd -a <user>

But why does it not sync with the linux credetials as indicated by unix password sync = Yes

I don't get it.

Score:0
cn flag

That's because is Samba which have to sync *Nix, not the reverse, so you must use smbpasswd to change a Samba enabled user. Internally, Samba know that have to change also the *Nix password and do that.
There is a couple options that could be setted to use a custom program to have syncro between the two, Samba and *Nix.

passwd program = /bin/another_program %u
passwd chat = *old*password* %o\n *new*password* %n\n *new*password* %n\n *changed*
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.