1

Recently I've had to reinstall Ubuntu Server 15.10 64-bit after wiping my home server due to an insecure password-only SSH server sitting on it for too long. Now, I'm plagued with setting my machine up again and along with it is Samba shares. I'm able to get Samba to correctly share a folder publicly, but I'm currently looking to make only 1 private share available that can only be signed in from the one main user on the machine.

Testparm gives no errors. Here is my smb.conf file.

I've made sure that:

  1. My user account is a part of the sambashare group.
  2. I have sudo smbpasswd -a <user> and sudo smbpasswd -e <user> for my username on the machine.
  3. My username has permission to read and write folders and files on the folder the share is pointed to.

To make sure there are no errors, I've increased the log level in smb.conf and here is the output of an average sudo service smbd restart on /var/log/samba/log.smbd.

Whenever I go to my Windows machines and go to my server's SMB shares, I see the share "storage" appear. Clicking on it makes it load for a tiny second and then it asks for authentication because access was denied. Then, I type in my server's username & password I set up with smbpasswd and it still says access is denied. What am I missing?

Note: I've installed samba previously on this machine and then immediately purged it after this failure occured. Later, I reinstalled samba and I noted some things were astray. I corrected them and I'm back to this issue again.

dylanweber
  • 111
  • 1
  • 9
  • I wrote an answer [here](http://askubuntu.com/a/724875/231142) that I tested and it worked. Maybe it might help you. I never heard a response from the person asking the question. – Terrance Feb 08 '16 at 03:30
  • @Terrance Thanks for the suggestion but those did not work. – dylanweber Feb 08 '16 at 03:51
  • @Terrance Think you can upload a copy of your smb.conf? Maybe I'll see what's different. – dylanweber Feb 08 '16 at 04:01
  • Sure, [here](https://paste.ubuntu.com/14991321/) you go. I did notice some `ntlmv` and `ntlm` that I have on my smb.conf that I didn't see in yours. None of my shares though are set for user level at the moment. – Terrance Feb 08 '16 at 04:07
  • I don't think it's that, I don't have ntlmv/ntlm in my setup and it's working fine here (both Windows and smbclient directly) –  Feb 08 '16 at 04:08
  • @Terrance I notice you don't have any private shares on your server. All your shares appear to be publicly available to guests. I am trying to host a share that is only accessible to one user. – dylanweber Feb 08 '16 at 04:09
  • @dylanweber Here are images of how mine is working. [First](http://i.imgur.com/AA46hiT.jpg) showing denied. [Second](http://i.imgur.com/wceo104.jpg) putting in username and password. [Third](http://i.imgur.com/tvZDBwP.jpg) access granted. Hoping we can get to the bottom of why your's isn't working. – Terrance Feb 08 '16 at 04:27
  • @dylanweber I changed the Whipple one to `guest ok = no` and `valid users = terrance` – Terrance Feb 08 '16 at 04:28
  • I have a feeling that the root of my issue has to do with the sambashare group. – dylanweber Feb 08 '16 at 04:28
  • I just took your config (@dylanweber), changed only the username to my own and the path to my regular share and I was able to connect with smbclient. So, I think you can rule out the config file as the source of the problem. –  Feb 08 '16 at 04:29
  • @dylanweber One quick question, you are restarting the `smbd` in between setting changes, right? `sudo service smdb restart` – Terrance Feb 08 '16 at 04:47
  • Yes definitely. Sometimes rebooting, even. Hopefully rebooting isn't too much. – dylanweber Feb 08 '16 at 04:47
  • @dylanweber OK, just checking. =) – Terrance Feb 08 '16 at 04:48
  • Really appreciate your help, I've been at this for over 24 hours and I cannot figure this out. – dylanweber Feb 08 '16 at 04:49
  • @dylanweber Have you tried your normal login password instead of the smbpasswd you set? – Terrance Feb 08 '16 at 04:59
  • They're both the same. `smbpasswd` is set to sync passwords, too. – dylanweber Feb 08 '16 at 04:59
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/35435/discussion-between-terrance-and-dylanweber). – Terrance Feb 08 '16 at 05:01
  • Have you tried `write list = dylanweber` instead of `valid user =` – prodigerati Feb 08 '16 at 05:03

2 Answers2

1

The CUPS errors are not an issue. I get those also with my setup and I have no trouble accessing samba shares.

Is your firewall turned on and if so, is samba being blocked?

Is the dylanweber user also a regular login id on your system? Have you tried using your regular login password (if different from what you set for samba)?

If you try to access the share directly from the linux box, does that work? i.e. something like:

> smbclient //1.2.3.4/storage

from a prompt in the 1.2.3.4 host itself logged in as dylanweber

  • Sadly, no. https://paste.ubuntu.com/14991225/ Additionally, my regular login password is the same as my Samba password. I don't know if Samba is being blocked by a firewall, but considering the fact that it's not working locally probably suggests something else is wrong. – dylanweber Feb 08 '16 at 03:49
  • NT_STATUS_ACCESS_DENIED sounds to me like you might not have access to that path as dylanweber in the filesystem. For instance, is the storage folder owned by root and not read/exe by anyone else? –  Feb 08 '16 at 04:01
  • When I SSH as dylanweber, I can touch files and edit files without sudo. I have read and write permissions on that directory. – dylanweber Feb 08 '16 at 04:02
  • long-shot question but is /media/storage some sort of fuse filesystem? such as encfs –  Feb 08 '16 at 04:34
  • Nope. It's a regular ext4 filesystem on a separate LVG partition mounted at /media/storage/ on boot. – dylanweber Feb 08 '16 at 04:35
0

The conclusion that I have reached is that I couldn't connect to my share because the version of Samba that is installed with Ubuntu 15.10 (Samba 4.1.17) had a bug that didn't allow it to properly authenticate users. My solution for this problem was installing Ubuntu 14.04.3 LTS and using Samba 4.1.6 along with it. Now Samba works flawlessly.

Note: I retried with a fresh copy of Ubuntu Server 15.10 to validate my conclusion and it is clear that Samba 4.1.17 in Ubuntu Server 15.10 is buggy.

My recommended solution? Install Debian instead.

dylanweber
  • 111
  • 1
  • 9