Configuring SELinux to allow the sharing of a directory by Samba

Tested on RHEL6/CentOS6.

As root:

# mkdir /data
# ls -dZ /data
drwxr-xr-x. root root unconfined_u:object_r:default_t:s0 /data
# semanage fcontext -a -t samba_share_t ‘/data(/.*)?’
# restorecon -R /data
# ls -dZ /data
drwxr-xr-x. root root unconfined_u:object_r:samba_share_t:s0 /data

You may also want to run the following:
setsebool -P samba_export_all_rw 1

Configuring Cisco LACP for EMC VNX 5300 SANs

The following is an example of how to create an LACP port-channel made up of two ports that will work with an EMC VNX 5300 SAN.

interface GigabitEthernet1/0/14
 description san-lacp-1
 switchport trunk encapsulation dot1q
 switchport mode trunk
 channel-group 2 mode active
end
interface GigabitEthernet1/0/15
 description san-lacp-2
 switchport trunk encapsulation dot1q
 switchport mode trunk
 channel-group 2 mode active
end
interface Port-channel1
 description san-lacp
 switchport trunk encapsulation dot1q
 switchport mode trunk
 spanning-tree portfast
end

The channel group mode must be “active”.

After creating the port-channel in the switch and configuring LACP on the SAN, you must “shutdown”  and then “no shutdown”  the port-channel.  This forces the SAN data mover ports to reconnect with the proper LACP values.

Copying Samba users from one server to another

Coping Samba users from one server to another is not as difficult as it sounds.

The following steps require root access. pdbedit won’t work as a regular user.

  1. On the source server export the user database.  In this example we use smbpasswd format.
    pdbedit -e smbpasswd:/root/samba-users.backup
  2. Copy the file to the second samba server.
  3. Import the backup into the password database.
    pdbedit -i smbpasswd:/root/samba-users.backup

That’s it.

It should be said, that if you are running multiple Samba servers and you want to have common users and groups, you should really be looking and a centralized user solution.  Samba 3 By Example is a good place to start.

 

Note on sharing a single LDAP database with multiple Samba servers

Quote:

“… to share a single set of users/groups in LDAP to multiple samba
servers you will need LDAP and a PDC and the other servers will be
BDCs. yes you will join BDC’s with net rpc join -D domain -S
pdc_server_name -U root%password

read chapter 5.3 of samba 3 by example.pdf”

– Adam Williams

Source: http://lists.samba.org/archive/samba/2008-August/142551.html

Switch to our mobile site