Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I followed these instructions to install Samba on both a CentOS 6.3 OS and a CentOS 6.5 OS.

http://rbgeek.wordpress.com/2012/05/25/how-to-install-samba-server-on-centos-6/

It only seemed to work on the 6.5. I've built 4 of these in 6.5, and am very familiar with the setup. When I did the exact same thing in 6.3, I wasn't able to view the files in Windows at UNC path \192.168.245.132\MyShare. But I am in all 4 of my 6.5 machines.

What could be wrong?

The only major difference on these OS's was the fact that the 6.3 had Selinux installed and it was set to "enforcing" (turned on). So I disabled it. In the 6.5 version, I installed it but it was disabled by default.

# DISABLE SELINUX (BEFORE ACCESSING UNC PATH ON WINDOWS)

[root@localhost i2b2-1.6]# sudo nano /etc/selinux/config

# OLD VALUE:

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

# NEW VALUE:

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

[root@localhost i2b2-1.6]# sudo service smb restart
Shutting down SMB services:                                [  OK  ]
Starting SMB services:                                     [  OK  ]
[root@localhost i2b2-1.6]# sudo service nmb restart
Shutting down NMB services:                                [  OK  ]
Starting NMB services:                                     [  OK  ]
[root@localhost i2b2-1.6]#

This is a picture from the 6.5 security of the "MyShare" folder (aka /samba/share/).

enter image description here

Picture from 6.3 install.

enter image description here

EDIT:

Now this is interesting. My share directory (/samba/share/) has a "." (dot) at the end of the permissions on 6.3 (non-working OS), and has a 3 following the permissions bits.

[root@localhost share]# ls -la
total 12
drwsrwsrwx. 3 root root 4096 May 27 18:42 .
drwxrwxrwx. 3 root root 4096 May 27 17:48 ..
drwxrwxrwx. 6 root root 4096 May 27 19:03 quick_install

The share directory (/samba/share/) does not have a "." (dot) at the end of the permissions on 6.5 (working OS), and has a 4 (not a 3) following the permission bits.

[root@localhost share]# ls -la
total 16
drwxrwxrwx 4 root root 4096 May 22 01:02 .
drwxr-xr-x 3 root root 4096 May 19 00:28 ..
drwsrwsrwt 2 root root 4096 May 23 00:37 certs
drwxr-xr-x 6 root root 4096 May 19 01:05 quick_install

http://superuser.com/questions/230559/what-does-the-dot-mean-at-the-end-of-rw-r-r-how-do-you-set-it-with-chmod

Question is, how do I remove it. I had to disable Selenix after this directory was created. How do I fix this?

EDIT #2:

Getting closer. Here is a reference, which wasn't 100% helpful.

http://superuser.com/questions/191903/how-do-i-remove-any-selinux-context-or-acl

This is called a SELinux ACL, not to be confused with the ligament from a lot of football injuries. The only problem is that I might have to restart the samba file share and reboot. But not sure.

[root@localhost share]# setfacl --help
setfacl 2.2.49 -- set file access control lists
Usage: setfacl [-bkndRLP] { -m|-M|-x|-X ... } file ...
  -m, --modify=acl        modify the current ACL(s) of file(s)
  -M, --modify-file=file  read ACL entries to modify from file
  -x, --remove=acl        remove entries from the ACL(s) of file(s)
  -X, --remove-file=file  read ACL entries to remove from file
  -b, --remove-all        remove all extended ACL entries
  -k, --remove-default    remove the default ACL
      --set=acl           set the ACL of file(s), replacing the current ACL
      --set-file=file     read ACL entries to set from file
      --mask              do recalculate the effective rights mask
  -n, --no-mask           don't recalculate the effective rights mask
  -d, --default           operations apply to the default ACL
  -R, --recursive         recurse into subdirectories
  -L, --logical           logical walk, follow symbolic links
  -P, --physical          physical walk, do not follow symbolic links
      --restore=file      restore ACLs (inverse of `getfacl -R')
      --test              test mode (ACLs are not modified)
  -v, --version           print version and exit
  -h, --help              this help text
[root@localhost share]#
share|improve this question
    
tried this and no luck: linoxide.com/how-tos/samba-for-windows-file-sharing –  Not MacGyver May 28 at 22:05
    
tried these 6 commands and no luck: cyberciti.biz/faq/… –  Not MacGyver May 28 at 22:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.