Tips for finding Knowledge Articles

  • - Enter just a few key words related to your question or problem
  • - Add Key words to refine your search as necessary
  • - Do not use punctuation
  • - Search is not case sensitive
  • - Avoid non-descriptive filler words like "how", "the", "what", etc.
  • - If you do not find what you are looking for the first time,reduce the number of key words you enter and try searching again.
  • - Minimum supported Internet Explorer version is IE9
Home  >
article

KB-4883: How to set up 2 interfaces’ Samba to AD using Centrify

Centrify DirectControl Plugins ,  

12 April,16 at 11:11 AM

Applies to: Centrify-Enabled Samba

Question: 

How to set up 2 instances of Samba using Centrify ? 

Answer: 


In order to setup 2 samba instances, separate Active Directory (AD) computer objects needed to be created for each instances.

In below example:
1. Interface eth0 will join to AD as "rh64" and second interface eth1 will join to AD as "rh64_2"
2. One instance will be started using interface eth0 and another instance will be started with eth1.
 
For the first instance using "eth0":
 
1. Join the machine normally with adjoin 

2. Setup the first samba interface using Centrify adbindproxy.pl.
Please find the detailed steps in Centrify Samba Administrator guide provided in the Centrify Samba package.


3. Once the setup has finished, please modify /etc/samba/smb.conf with adding below change.
 
 bind interfaces only = yes
 
 interfaces   = <interface name>
 
E.g.
 
 bind interfaces only = yes
 
 interfaces   = eth0

4. Restart Centrify Samba.

e.g.

/etc/init.d/centrifydc-samba restart
 
Setup for the second interface samba:
 
1. Create PID directory :
mkdir -p /var/run/samba2
 
2. Create Lock directory
mkdir -p /var/cache/samba2
 
3. Create Private Directory:
mkdir -p /etc/samba/private2
 
4. Clone the smb.conf as smb2.conf
    [root@rh64 Desktop]# cp /etc/samba/smb.conf /etc/samba/smb2.conf
 
5. Add the below to smb2.conf
   
pid directory     = /var/run/samba2
lock directory   = /var/cache/samba2
private dir        = /etc/samba/private2
 
bind interfaces only = yes
 
interfaces = eth1
 
6. Modify the netbios name in smb2.conf from rh64 to rh64_2
 netbios name = rh64_2
 
7. Create the computer object and save the samba computer password by command:
 
[root@rh64 Desktop]# net ads join -U administrator -s /etc/samba/smb2.conf
Enter administrator's password:
Using short domain name -- ALBERT
Joined 'RH64_2' to dns domain ‘albert.local'
 
8. Start the second instance manually by the below commands.
 
[root@rh64 Desktop]# /opt/centrify/samba/sbin/nmbd -s /etc/samba/smb2.conf
[root@rh64 Desktop]# /opt/centrify/samba/sbin/smbd -s /etc/samba/smb2.conf
[root@rh64 Desktop]# /opt/centrify/samba/sbin/winbindd -s /etc/samba/smb2.conf
 
9. Verifying the result:
a. First interface samba.  
Domain=[ALBERT] OS=[Unix] Server=[Samba 3.6.22-cdc-4.5.7-403]
 
            Sharename       Type      Comment
            ---------       ----      -------
            samba-test      Disk     
            IPC$            IPC       IPC Service (Samba 3.6.22-cdc-4.5.7-403)
            printer:1       Printer   printer
            mobile          Disk      Home Directories
Domain=[ALBERT] OS=[Unix] Server=[Samba 3.6.22-cdc-4.5.7-403]
 
            Server               Comment
            ---------            -------
            RH64                 Samba 3.6.22-cdc-4.5.7-403
              
 
            Workgroup            Master
            ---------            -------
            ALBERT               RH64
 
 b. Second interface samba.
 
Domain=[ALBERT] OS=[Unix] Server=[Samba 3.6.22-cdc-4.5.7-403]
 
            Sharename       Type      Comment
            ---------       ----      -------
            samba-test3     Disk     
            IPC$            IPC       IPC Service (Samba 3.6.22-cdc-4.5.7-403)
            printer:1       Printer   printer
            mobile          Disk      Home Directories
Domain=[ALBERT] OS=[Unix] Server=[Samba 3.6.22-cdc-4.5.7-403]
 
            Server               Comment
            ---------            -------
            RH64_2               Samba 3.6.22-cdc-4.5.7-403
 
            Workgroup            Master
            ---------            -------
            ALBERT               RH64_2


10. Verifying from windows side.

a. First samba interface: 

User-added image

b. Second samba interface:

 User-added image



Note:
1. The above example is a proof-of-concept only.
2. Please make sure the firewall has been opened if accessing from Windows side has failed. (iptables command will help)
3. The above example was performed in RedHat Systems. The command may varies on different OS.
4. Startup script can be setup by referencing the following wiki page:

REF:

https://wiki.samba.org/index.php/Multiple_Server_Instances


 

Still have questions? Click here to log a technical support case, or collaborate with your peers in Centrify's Online Community.