Login Fail Samba Share

I have samba set up and my Windows PC can see and read the files. But I have a media player that I use, when I try to go to the samba share it sees the shared drive and asks for the login. I use the samba user and password but I get login fails.

My smb.conf

	workgroup = SAMBA
	security = user

	passdb backend = tdbsam

	printing = cups
	printcap name = cups
	load printers = yes
	cups options = raw

	comment = Home Directories
	valid users = %S, %D%w%S
	browseable = No
	read only = No
	inherit acls = Yes

	comment = All Printers
	path = /var/tmp
	printable = Yes
	create mask = 0600
	browseable = No

	comment = Printer Drivers
	path = /var/lib/samba/drivers
	write list = @printadmin root
	force group = @printadmin
	create mask = 0664
	directory mask = 0775

	comment = WDBlue4TB
	path = /mnt/33d86236-f42b-4fd9-a984-cf5b9113773f/
	read only = yes
	guest only = no
	guest ok = yes
    share modes = yes`Preformatted text`

Hi @jjis2020! Welcome to Ask Fedora! Please have a look at the introductory posts in the #start-here category if you haven’t had a chance to do so.

Which of your samba shares do you try to connect your media player to? Is it WDBlue4TB?

I’ve seen that when you have guest login enabled (as you do for WDBlue4TB) some samba clients still won’t connect without some username and password. I usually enter something like guest for login and guest for password – and I don’t have user named guest on my samba server.

Please try if this works for you, and if not – then I’d suggest looking through samba logs to troubleshoot the issue.

To increase log verbosity you can add log level = 3 (or even more – up to 10) to the [global]* section of your smb.conf file. Remember to remove or comment this line after you’ve debugged your problem as verbose samba logging can consume hard drive space quite quickly (for higher logging levels).

Also this page on samba wiki details how to enable logging for one client only (your media player in your case).

One other obvious solution would be to add a real user account specifically for your medial player’s use – though generally it’s not needed. But at the same time it’s more secure – even in your home network – which is always a plus. :slight_smile:

Here is the media player log.

Is there a good tutorial for add the media player specifically to Samba?

@jjis2020, first of all, I’m not an expert on samba configuration, I’ve done it several years ago and it’s working for me since with some minor tweaking like adding new shares/folders or/and users – so I know it’s not that hard to do :slight_smile: Sadly I don’t have ready answers and quick solution for you – but I can help you debug this and hopefully make this work.

I don’t know such a tutorial from the top of my head. You won’t need to add something specific for media player, you’ll add just an ordinary user account (from Linux/samba perspective). It’s not that hard to do, but it’s definitely more work than just connecting using guest account. Also it sort of pointless from the security point of view – I think so – if you’ll leave guest/passwordless access to other clients (including Windows).

So it makes sense to do one of the (from simple and insecure to harder and more secure):

  1. No login/password required to access your shares. You’re on a home network, you understand potential risks, you’re ok with them and don’t want the hassle.

  2. You don’t want a fully open and accessible to anyone shares, so you make one samba account and use it on all your clients.

  3. You add different accounts for different clients, possibly with different clients having access to different resources.

So I’ll suggest you to choose one of this “strategies” and then we can go from there.

On the how-to front you may want to look here:

and maybe here as well:

Regarding log file you’ve posted.

  1. Is it with log level = 3 or more?

  2. It looks like samba says NT_STATUS_NO_SUCH_USER – i.e. it doesn’t know user which is used to connect. Definitely guest/guest doesn’t work, I can’t say from the log if the same happens when you mediplayer tries to connect without username and password.

I believe NO_SUCH_USER thing can be amended with adding these parameters to smb.conf – to global section and share-specific section respectfully:

        map to guest = Bad User
        guest account = existing_samba_account_name

        force user = existing_samba_account_name
        create mask = 0664
        directory mask = 0775

Also for additional testing I recommend doing this on you Fedora box. Install samba-client if it isn’t already installed:

sudo dnf install samba-client

Use smbclient to test your connection to samba resources from cli. I assume that your Fedora box is your samba server and that you’re trying to connect mediaplayer to WDBlue4TB share. To try to connect as guest:

smbclient --user guest //localhost/WDBlue4TB
Enter guest's password:

Test both entering “guest” as the password and – separately – just pressing enter (i.e. using empty password).

Second test is for no username:

smbclient --user "" //localhost/WDBlue4TB

You’ll most likely receive answer NT_STATUS_NO_SUCH_USER – please post if you did, or did you connect, or which other answer did you receive.

If you’ll connect successfully you’ll see something like

Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.2.10]
smb: \>

Type ls here to see a directory listing. By the way, if you have problems with user access rights – you’ll see it after entering ls on this step. When all is working ok – you’ll see a directory/files listing.

Press [Ctrl-D] or type exit to disconnect and return to you cli.

Please try this and post your results.

1 Like
sudo -u nobody -g nobody stat /mnt/33d86236-f42b-4fd9-a984-cf5b9113773f

What does this say?

1 Like
```File: /mnt/33d86236-f42b-4fd9-a984-cf5b9113773f

Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 811h/2065d Inode: 2 Links: 5
Access: (0700/drwx------) Uid: ( 1000/ donnie) Gid: ( 1000/ donnie)
Context: system_u:object_r:unlabeled_t:s0
Access: 2019-09-26 00:52:13.521894266 -0400
Modify: 2019-08-18 04:46:37.703335276 -0400
Change: 2019-08-18 04:46:37.703335276 -0400
Birth: 2019-06-02 17:44:19.000000000 -0400```

1 Like

I did get this error when trying the samba client, NT_STATUS_NO_SUCH_USER.

I reinstalled Fedora and tried a different way to set up Samba.


There’s a restricted and fully accessed method. The fully accessed method worked with the media player, restricted did not.

1 Like

Have you added user to “security” group, as per instruction?

Test login with smbclient as we did earlier (using newly created username and password for restricted mode) and note samba’s answer if you can’t login.

1 Like

These permissions don’t allow guest access.
Also, SELinux context should be samba_share_t.

1 Like