5

I set up a Samba server on Ubuntu. Everything goes fine when I allow guest access, but when I try to setup a configuration for a specific user, I receive the error below:

$ smbclient  //x.x.x.x/john -U john
Enter john's password:
Domain=[MYDOMAIN] OS=[Unix] Server=[Samba 4.1.6-Ubuntu]
tree connect failed: NT_STATUS_ACCESS_DENIED

Here's the configuration on server side (/etc/samba/smb.conf):

[john]
    comment = Ubuntu File Server Share
    path = /home/john
    browsable = yes
    guest ok = yes
    read only = no
    create mask = 0755
    valid users = john
    writable = yes

Please note that:

  • john account exists in /etc/passwd
  • /home/john exists and it's owned by john:john
  • as mentioned, the connection works fine when I allow guest access

It's the first time I do this. Am I missing something?

1 Answer 1

7

It turns out that, besides the Unix username, I'm also required to add a Samba username with the command below:

smbpasswd -a john

To see the users that are already created the command below can be used:

sudo pdbedit -L
1
  • It also solved my problem on OpenSUSE Leap 42.2
    – Megidd
    Jul 5, 2017 at 10:27

You must log in to answer this question.

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