I'm used to setting up Samba shares through Nautilus (GTK 2), which is rather easy. However, I haven't used it in a long time, and now I use Xubuntu, which uses Thunar. So, I decided to try setting up a Samba share through the command-line, editing pertinent text files and such.

I have been successful in viewing my own share from the server, entering the password for the user I created with

sudo smbpasswd -a <user_name>

The only username it would let me create was the same as that of my logged in user for my computer. I have been successful with viewing the share as a guest from a client computer.

However, I have not been able to view the share from the client computer with a username and password. I tried using the same username and password that worked from the server, to no avail. It did ask for a password, but didn't recognize the username/password. I tried creating another user from the server (for that computer, and then I made a samba user with the same name) with the name of the logged in user on my client computer (to no avail).

Here's what I appended to the end of /etc/samba/smb.conf (with three spaces for the indent instead of four, since that's what the file does):

   path = /home/myUser1/myPath
   read only = no
   writeable = yes
   valid users = myUser1 myUser2
   create mask = 0664
   directory mask = 0775
   force user = myUser1

I did make sure to set the permissions on the shared folder to 775, and I did sudo chown -hR myUser1:myUser2 myPath—again, to no avail (except for guest access).

What else do I need to do?

Similar questions exist, but they don't seem to be having the same problem. Maybe they know something I don't.

For reference, to allow guests to log in, I just replace valid users = myUser1 myUser2 above with guest ok = yes, and it works fine from the client after I do sudo service smbd restart.

To be clear, myUser1 is the name of the logged in user on the server. myUser2 is the name of the logged in user on the client. I even tried creating a Samba user named myUser1 on the client (to no avail).

I read something once about how you need to activate Samba users after creating them, but I wasn't too clear on the details and if it really was necessary as stated, since hardly anyone who talks about creating Samba shares ever mentions it, as far as I've seen, and the file they mentioned editing didn't exist.

Perhaps instead of setting the group to be the user with the same name as my client, maybe I need to make sambashare to be the group. Maybe I need to create a Samba user named myUser2 on my client.

My client uses Xubuntu 16.10 (64-bit), and my server uses the one before that (Xubuntu 16.04—32-bit).


The users with access to the samba shares don't have to be logged in. However you have to have the user accounts for all the users to be real accounts on the server.

First create the users on the server that you want to have access:

$ sudo adduser myUser1
$ sudo adduser myUser2

Then create and assign passwords for the samba users:

$ sudo smbpasswd -a myUser1
$ sudo smbpasswd -a myUser2

Your /etc/samba/smb.conf file looks ok. I would create a common area for the shares and link the common area to my personal space. But that's a matter of preference.

The samba user doesn't have to exist on the client machine. Just mount the samba share to the client's machine using the credential created with the smbpasswd -a command.

  • Huh. I tried that, and I do believe that you're correct in what you say, but it won't authenticate from the client computer for some odd reason. It must be a bug in one of the Xubuntu versions I'm using or something. I can just use guest access for now, since no one else in my network is setup to access network shares. – Brōtsyorfuzthrāx Jan 8 '17 at 2:39
  • I could try logging in with a different client computer to see if it's a problem with the one I've been using (it's possible something I installed is causing problems). – Brōtsyorfuzthrāx Jan 8 '17 at 2:43
  • What is the output of: sudo pdbedit -L -v | egrep "Unix username"? – L. D. James Jan 8 '17 at 3:22
  • On the server, it lists root, smbguest, myUser1, and myUser2 (or rather the names I used those to anonymously represent). – Brōtsyorfuzthrāx Jan 10 '17 at 3:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.