LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problem setting up samba -- Korora 21 (Fedora) (https://www.linuxquestions.org/questions/linux-newbie-8/problem-setting-up-samba-korora-21-fedora-4175536889/)

jim.thornton 03-16-2015 09:50 AM

Problem setting up samba -- Korora 21 (Fedora)
 
I've got my new system up and running. It's a nice fresh change after running Linux Mint for the past 4 years. Now comes the time of setting things up the way I like them.

As part of my setup, I have a all of my DVD's backed up onto my computer so that I can use a media server in the house. I run XBMC at my TV's with a central samba server (my computer) holding the movies.

In LM, all I had to do was right-click the directory "sharing" and select SMB share and type in the name. Everything else was done for me. This doesn't seem that simple.

Here's what I've done:
1. Menu > Administration > Samba
2. Entered in all the directories to share, under the BASIC tab I've selected visibile, writeable. Under the ACCESS tab I've selected a user (see below).
3. I've created a system user called xbmc with the password of xbmc.
4. I've created a samba user called xbmc with the password of xbmc.

Still not working. So, I went into the shell where I manually started the smb service:
# systemctl start smb.service

So, I went back to Menu > Administration > Samba > Preferences:
Set workgroup to WORKGROUP (but it automatically changes it to lower case after I exit).

Drop to terminal and restart service with systemctl.

I go over to my XMBC installation and try to connect to the source and it finds the SMB share. I click on it and after about 30 seconds a window pops up asking for login credentials. I enter xbmc/xbmc and after about 30 seconds it just cycles through. XMBC doesn't offer any messages, so I went downstairs to my Windows machine and tried to connect to a network drive. I enter in \\IP\share-name and after a few seconds it asks for login credentials. I enter xbmc/xbmc but then it fails with "bad username or password".

I'm not sure what I need to do to get this working.

Here is my /etc/samba/smb.conf file:
http://pastebin.com/m9ExpPJF

System Korora 21 (just installed/updated)
kernel: 3.18.9-200.fc21.x86_64

jim.thornton 03-16-2015 10:07 AM

I should also say that I watched a video and they disabled SELinux so I tried that too. However, it didn't work.

I've re-enabled SELinux because I didn't like the fact that it had me disable it. To re-enable it I just changed it setting back to "enforcing" from "disabled"

jim.thornton 03-16-2015 10:38 AM

I'm still working on this, so any help would be greatly appreciated. I've run the following command (with output):

Code:

> smbclient -U xmbc -L localhost
Enter xmbc's password:
session setup failed: NT_STATUS_LOGON_FAILURE


RiXtEr 03-16-2015 02:29 PM

Have you created the user for samba?

smbpasswd -a xbmc

If so confirm that the user is there by using pdbedit -lv also confirm that samba is running by using ps ax | grep smbd

jim.thornton 03-16-2015 02:40 PM

Yes, I have created the samba user (see #4 in the OP). However, your pdbedit command didn't work.
Yes, I have confirmed that samba is running both with systemctl and your ps command.

I have also tested with the following command and output:
Code:

> smbclient -U xmbc -L localhost
Enter xmbc's password:
session setup failed: NT_STATUS_LOGON_FAILURE


gor0 03-16-2015 03:14 PM

korora IS NOT Fedora !!!

fixed!

jim.thornton 03-16-2015 04:01 PM

Quote:

Originally Posted by gor0 (Post 5333055)
korora IS NOT Fedora !!!

fixed!

And your comment was in no way related to my original post!

I said Koroa and put in brackets fedora so that if someone wasn't familiar with korora and was with fedora they could still probably help since IT IS BASED on Fedora.

jim.thornton 03-16-2015 04:45 PM

OK... I decided to start from scratch and I removed my shares that I had added. Then I removed the samba user. I then re-added the samba user and re-added the share. Now this is what I get:

Code:

# smbclient -U xbmc -L localhost
Enter xbmc's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.1.17]

        Sharename      Type      Comment
        ---------      ----      -------
        movies          Disk     
        IPC$            IPC      IPC Service (Samba Server Version 4.1.17)
        xbmc            Disk      Home Directories
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.1.17]

        Server              Comment
        ---------            -------
        MSI-DESKTOP          Samba Server Version 4.1.17
        XBMCBUNTU            xbmc-nT435-nT535 server (Samba, XBMC)

        Workgroup            Master
        ---------            -------
        WORKGROUP            XBMCBUNTU

Within XBMC I dropped to the shell using CTRL+ALT+F2. I then logged in as xbmc and ran the following command:
$ smbclient -U xbmc -L 192.168.1.166

That gave pretty much the same output as above.

I then went back into Ubuntu within the XBMC box and I opened up a folder, browsed the network where I saw the computer, double clicked it and saw the only thing there was my share (movies). I clicked on that and was prompted for username and password. It had WORKGROUP entered for "Domain" which I don't know why that is. But, I entered in the username and password and it failed to mount the share.

I'm really puzzled but feel that I'm getting close and would appreciate any help that I can get please!

jim.thornton 03-16-2015 08:09 PM

I could really use some help here please. So far a couple hundred views and only a couple of responses??

I've now gotten it to connect via: $ smbclient -U xbmc //192.168.1.166/movies

When I enter that command it asks for a password and then goes the the smb:/> prompt. Then I enter ls or dir and I get NT_ACCESS_DENIED again.

Any suggestions. I'm reading more and it seems SELinux might be the problem but I don't think it is smart to disable it??

jim.thornton 03-16-2015 08:54 PM

After getting really close and still getting an ACCESS DENIED message, I finally decided to disable SELinux again and it is now working.

In my efforts to get it working, I set my permissions to /media (where I'm mounting my storage drive with the movies) at 777.

What are the correct settings and ownership settings for my setup?

Main user: jthornton
File/directory ownership: jthornton:jthornton

What do the permissions need to be to be able to have user xbmc access the files/directories?

zafar_dandoti 03-17-2015 09:08 AM

Code:

chown -cR xbmc:xbmc /media
Code:

chmod -cR 770 /media
If u dont want to disble selinux u can add file context to ur samba share
Code:

chcon -t samba_share_t -R
/media


jim.thornton 03-17-2015 09:25 AM

I read up a lot on SELinux and while there were some saying not to just disable SELinux there were quite a lot of people saying that they understood how to get things working with SELinux but the reward is just not worth the hassle. So I decided to disable.

I changed ownership to jthornton:jthornton since this is my regular user. I then added xbmc to the jthornton group. I then chmod'd all files and directories to 770 jthornton:jthornton.

Is that okay?


All times are GMT -5. The time now is 01:27 AM.