LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-20-2014, 09:57 PM   #1
Ciffy
LQ Newbie
 
Registered: Apr 2014
Posts: 11

Rep: Reputation: Disabled
Help with Samba configuration?


Hey all, I typically can figure things out on my own, but this one's got me stumped.

I'm running RHEL 6.4 on a pretty beefy Dell server. I've got a 2nd hard drive mapped and showing up everywhere BUT as a mapped drive. When I attempt to map to the IP from a Mac or PC, I can map to the share that's pointing to the 2nd drive, but it shows up empty. It's setup the same way as other shares on the same box and the other shares are working - like I said, it's a headscratcher to me.

Here's my fstab configuration:

Code:
#
# /etc/fstab
# Created by anaconda on Wed Jun 26 09:46:40 2013
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_tomahawk-lv_root /                       ext4    defaults        1 1
UUID=46e22c9e-54de-4ea3-8c97-38498bf1a827 /boot                   ext4    defaults        1 2
/dev/mapper/vg_tomahawk-lv_home /home                   ext4    defaults        1 2
/dev/mapper/vg_tomahawk-lv_swap swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
LABEL=/scratch          /scratch                ext4    defaults        1 2
Here's my smb.conf:

Code:
[user@tomahawk samba]$ vi smb.conf
[global]

netbios name = tomahawk
workgroup = WORKGROUP
log file = %S.log
hosts allow = ALL
bind interfaces only = yes

log level = 2
log file = /var/log/samba/samba.log.%m
max log size = 100
debug timestamp = yes

# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user’s home directory as \\server\username
[homes]
comment = Home Directories
browseable = yes

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server. Un-comment the following parameter
# to make sure that only “username” can connect to \\server\username
valid users = %S

# By default, the home directories are exported read-only. Change next
# parameter to ‘yes’ if you want to be able to write to them.
writable = yes

[userhome]
        path = /home/user
        writeable = yes
        browseable = yes
        valid users = tangi anna alisha brian

[shared]
        path = /home/samba/shared
        writeable = yes
        browseable = yes
        valid users = user tangi anna alisha brian

[scratch]
        path = /scratch
        writeable = yes
        browseable = yes
        valid users = user tangi anna alisha brian
I can cd into /scratch and there are files listed. I have a symbolic link in a number of user's home directory to make working with R and a few other programs easier and all of the links work. I can map to home directories without a problem via SMB on a mac or "map network drive" on windows, but scratch just shows up as an empty drive.

For giggles, I chmodded /scratch and everything in it to 777 thinking it might be a permissions issue, but no smiles.

Code:
[user@tomahawk samba]$ cd /
[user@tomahawk /]$ ls -l
total 224
dr-xr-xr-x.   5 root root  12288 Apr 16 03:28 bin
dr-xr-xr-x.   5 root root   3072 Apr 15 18:32 boot
drwxr-xr-x.  10 root root   4096 Dec  2 11:31 cgroup
drwxr-xr-x.  18 root root   3900 Apr 15 18:33 dev
drwxr-xr-x. 132 root root  12288 Apr 19 03:40 etc
drwxr-xr-x.   9 root root   4096 Mar  5 14:31 home
dr-xr-xr-x.  13 root root   4096 Apr 15 18:10 lib
dr-xr-xr-x.  11 root root  12288 Apr 16 03:27 lib64
drwx------.   2 root root  16384 Jun 26  2013 lost+found
drwxr-xr-x.   2 root root   4096 Mar 21 15:29 media
drwxr-xr-x.   2 root root      0 Apr 15 18:33 misc
drwxr-xr-x.   2 root root   4096 Jun 28  2011 mnt
drwxr-xr-x.   2 root root      0 Apr 15 18:33 net
drwxr-xr-x.   4 root root   4096 Jun 26  2013 opt
dr-xr-xr-x. 476 root root      0 Apr 15 18:32 proc
dr-xr-x---.  37 root root   4096 Apr 15 18:07 root
dr-xr-xr-x.   2 root root  12288 Apr 16 03:28 sbin
drwxrwxrwx.  16 root root   4096 Apr  5 12:25 scratch
drwxr-xr-x.   7 root root      0 Apr 15 18:32 selinux
-rw-r--r--.   1 root root   3112 Jul 10  2013 %S.log
drwxr-xr-x.   2 root root   4096 Jun 28  2011 srv
drwxr-xr-x.  13 root root      0 Apr 15 18:32 sys
drwxrwxrwt.  16 root root 106496 Apr 20 03:29 tmp
drwxr-xr-x.  14 root root   4096 Jun  6  2013 usr
drwxr-xr-x.  23 root root   4096 Jun 27  2013 var
[user@tomahawk /]$ cd /scratch
[user@tomahawk scratch]$ ls -l
total 840
drwxrwxrwx.  5 user   user     4096 Mar 26 20:49 ACoffey_CCMicrobiomeAnalysis
drwxrwxrwx.  3 root   root     4096 Nov  3 09:04 backup
drwxrwxrwx. 11 user   user     4096 Mar 25 14:59 CCMicrobiomeProject
drwxrwxrwx.  2 tangi  tangi  131072 Oct 31 11:04 CopyOfpomp
drwxrwxrwx.  2 tangi  tangi   61440 Jan 14 14:41 CopyOfpompDO1miceonly
drwxrwxrwx.  2 tangi  tangi   53248 Jan 14 14:41 CopyOfpompDO2miceonly
-rwxrwxrwx.  1 tangi  tangi   32924 Sep  5  2013 DO1 Final Phenotypes File_9.4.2013.csv
-rwxrwxrwx.  1 tangi  tangi    5789 Oct 31 22:48 DO1 Kinship.R
-rwxrwxrwx.  1 tangi  tangi   83420 Sep  5  2013 DO2 Final Phenotypes File_9.5.2013.csv
drwxrwxrwx.  2 tangi  tangi    4096 Feb  5 21:29 DOQTL_0.99Feb2014forserver
-rwxrwxrwx.  1 user   user     4772 Aug 21  2013 DOQTL code_changed.R
-rwxrwxrwx.  1 user   user     5435 Aug 21  2013 DOQTL code.R
drwxrwxrwx.  4 user   user     4096 Sep  5  2013 DOSCRATCH
drwxrwxrwx.  2 root   root    16384 Aug 13  2013 lost+found
-rwxrwxrwx.  1 user   user     6161 Aug 28  2013 newDOQTLpackage_8_28_13.R
-rwxrwxrwx.  1 user   user     6161 Sep  5  2013 newDOQTLpackage.R
-rwxrwxrwx.  1 user   user     6161 Sep  5  2013 newDOQTLpackagetry2.R
-rwxrwxrwx.  1 user   user     6161 Sep  5  2013 newDOQTLpackagetry3.R
drwxrwxrwx.  2 user   user    94208 Oct 31 08:50 pomp
drwxrwxrwx.  2 tangi  tangi   77824 Jan 14 16:07 pompDO1DO2micecombined
drwxrwxrwx.  2 tangi  tangi   77824 Nov 18 10:53 pompDO1miceonly
drwxrwxrwx.  2 tangi  tangi  131072 Nov 18 21:08 pompDO2miceonly
-rw-r--r--.  1 alisha alisha  11197 Apr  1 16:35 Read1_UnweightedUniFrac_PCoA.pdf
-rwxrwxrwx.  1 user   user       28 Dec 17 21:08 recombinations.csv

Help me Obi Wan Kenobis, you're my only hope.

Last edited by Ciffy; 04-20-2014 at 09:59 PM.
 
Old 04-21-2014, 02:37 AM   #2
brak44
Member
 
Registered: Aug 2010
Location: Brisbane Australia
Distribution: Centos, Fedora
Posts: 87

Rep: Reputation: 24
Is SELinux enabled?
 
Old 04-21-2014, 07:13 AM   #3
Ciffy
LQ Newbie
 
Registered: Apr 2014
Posts: 11

Original Poster
Rep: Reputation: Disabled
Yes. And after digging to figure out what that was and changing it to permissive and restarting, I CAN see the share now. So that's definitely the problem. Since I read up on it while I was trying to follow through, I see that i probably shouldn't just leave it at permissive since it's security measures, so I've turned it back to enforcing, but where do I fix whatever needs fixing so I can see the share and have SELinux running? Thanks.
 
Old 04-21-2014, 08:51 AM   #4
Ciffy
LQ Newbie
 
Registered: Apr 2014
Posts: 11

Original Poster
Rep: Reputation: Disabled
Got it, thank you. Found my answer on the fedora project wiki:

FILE_CONTEXTS
SELinux requires files to have an extended attribute to define the file
type. Policy governs the access daemons have to these files. If you
want to share files other than home directories, those files must be
labeled samba_share_t.
So if you created a special directory /var/eng,
you would need to label the directory with the chcon tool.

chcon -t samba_share_t /var/eng

To make this change permanent (survive a relabel), use the semanage
command to add the change to file context configuration:

semanage fcontext -a -t samba_share_t "/var/eng(/.*)?"
This command adds the following entry to /etc/selinux/POLICYTYPE/con‐
texts/files/file_contexts.local:

/var/eng(/.*)? system_ubject_r:samba_share_t:s0

Run the restorecon command to apply the changes:

restorecon -R -v /var/eng/

Originally found on: http://fedoraproject.org/wiki/SELinux/samba
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SAMBA Configuration - Cannot access SAMBA Shares Gyrogypsy Linux - Newbie 7 04-09-2012 10:47 PM
Samba configuration dpeterson3 Linux - Software 6 01-01-2009 03:09 PM
Samba Configuration ..? matrixpk Linux - Networking 13 05-31-2005 09:55 AM
Samba configuration help Krenn Slackware 3 07-30-2004 07:22 PM
samba configuration pantera Red Hat 1 06-24-2004 06:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration