Problem
How to configure samba4 with windows domain integration on UnixWare 7 or OpenServer6 Definitive 2018
Solution
This procedure describes how to configure samba4 on UnixWare7 or OpenServer6 Definitive 2018 (D2M1/M2) with windows domain integration.
-Make sure Update Pack 1 is installed on the UW7D or OSR6D installation. If not, purchase and install an Update Pack 1 license for Definitive Run patchck to install the Update Pack 1.
-Check that the system time on the 6D/7D server is in sync with the windows domainserver. Setup an NTP client on the 6D/7D server when out of sync. See TA111921 for help.
-Define the Windows Domain server as nameserver and add
the domainname to your /etc/resolv.conf
# cat /etc/resolv.conf
nameserver 172.24.123.1
domain mydomain.com-Configure your system on the Windows DNS server.
Define the Forward and Reverse Lookup Zones
*check reverse dns lookup
# host 172.24.123.195
195.123.24.172.in-addr.arpa domain name pointer
definitive.mydomain.com.
*Check forward dns lookup
# host definitive.mydomain.com
definitive.mydomain.com has address 172.24.123.195-Check if the 'hostname' command returns the correct domainname. if not, set the correct domainname using 'hostname -s".
-If you have samba3 installed, you should remove it using the command: # /opt/xinuos/sbin/setup-samba.sh -r The samba3 configuration files are saved to a tar archive.
-Setup the samba4 configuration files
# /opt/xinuos/sbin/setup-samba.sh
Installing smb.confa) Stand Alone Server d) Active Directory Domain Member
Which one? d
Enter Machine name: [definitive]
Machine name set to "definitive".Installing krb5.conf Installing user.map Enable starting Samba daemons at boot time? (recommended)[Yes]
Start Samba daemons now? (recommended) [Yes]Make sure /etc/opt/xinuos/samba/smb.conf is configured like you want it.
-Join the 6D/7D server to the windows domain. Use the
windows credentials of a domain administrator to join.
# net ads join -U Administrator@mydomain.com
Using short domain name -- mydomain
Joined 'definitive' to dns domain 'mydomain.com' -Restart the samba processes and check that smbd, nmbd and
winbindd processes are all running.
# /etc/init.d/samba-xinuos restart
# ps -ef | grep -e mbd -e winbind
root 2196 2195 TS 80 0 12:50:41 ? 0:00
/opt/xinuos/sbin/winbindd -l/var/opt/xinuos/samba/log
-s/etc/opt/xinuos/samba/s
root 2188 2186 TS 80 0 12:50:31 ? 0:00
/opt/xinuos/sbin/smbd -D -s/etc/opt/xinuos/samba/smb.conf
root 2189 2186 TS 80 0 12:50:31 ? 0:00
/opt/xinuos/sbin/smbd -D -s/etc/opt/xinuos/samba/smb.conf
root 2195 1 TS 80 0 12:50:41 ? 0:00
/opt/xinuos/sbin/winbindd -l/var/opt/xinuos/samba/log
-s/etc/opt/xinuos/samba/s
root 2190 1 TS 80 0 12:50:31 ? 0:00
/opt/xinuos/sbin/nmbd -D -l/var/opt/xinuos/samba/log
-s/etc/opt/xinuos/samba/sm
root 2186 1 TS 80 0 12:50:31 ? 0:00
/opt/xinuos/sbin/smbd -D -s/etc/opt/xinuos/samba/smb.conf
root 2194 2186 TS 80 0 12:50:32 ? 0:00
/opt/xinuos/sbin/smbd -D -s/etc/opt/xinuos/samba/smb.conf-The samba has as default a 'tmp' share that includes all files in /var/tmp/.Samba. This share can be used for test.
-Create a test file in this samba test directory:
# ls >/var/tmp/.Samba/list.txt# smbclient //definitive/tmp -U <Windows_User>
Enter <Domain>\<Windows_User>'s password:Try "help" to get a list of possible commands.
smb: \> dir
. D 0 Fri Nov
10 12:03:41 2023
.. D 0 Fri Nov10 09:29:20 2023
list.txt N 195 Fri Nov
10 12:03:01 2023
550912 blocks of size 1024. 550800 blocks availablesmb: \> get list.txt getting file \list.txt of size 195 as list.txt (38.1 KiloBytes/sec) (average 38.1 KiloBytes/sec)
smb: \> put list.txt list2.txt
putting file list.txt as \list2.txt (63.5 kb/s) (average
63.5 kb/s)
smb: \> dir
. D 0 Fri Nov
10 12:03:41 2023
.. D 0 Fri Nov
10 09:29:20 2023
list.txt N 195 Fri Nov
10 12:03:01 2023
list2.txt N 195 Fri Nov
10 12:46:36 2023
550912 blocks of size 1024. 550800 blocks availablesmb: \> quit-Test access to \\definitive\tmp on a windows environment and login with windows domain user credentials.
-Accessing the 'homes' share:
As a default the 'homes' share is enabled in smb.conf
To access this share the /%H/Samba/%U must be created and having
the correct access rights.
%H is the homedirectory of a windows user. %U is the username.
Both are all lowercase characters names.
Executing the command 'wbinfo -i <domain_user>' displays the
homedirectory in its 6th field.
wbinfo output example:
winuser:*:21113:20513:winuser:/home/mydomain/winuser:/bin/ksh
# mkdir -p /home/mydomain/winuser/Samba
# chmod -R winuser /home/mydomain/winuser/Samba
# chgrp -R "domain users" /home/mydomain/winuser/Samba
Now the share can accessed using:
# smbclient //definitive/homes -U winuser
On windows this homes share can be accessed just by user winuser
as \\definitive\winuser.Usefull tools used while debugging samba:
-Check syntax and view settings in smb.conf
# testparm -s (Check and view modified settings in smb.conf
# testparm -s -v (check and view modified and default settings)-View connected samba users and accessed shares on the server. Also displays the smb protocol version used. # smbstatus
-Display uid, username, gid and group name
# id <windows_user>-Display all users in your domain
# wbinfo -u-Display all groups in your domain
# wbinfo -g-Report user info
# wbinfo -i <domain_user>-Check if winbindd is running
# wbinfo -p-Check the NETLOGON for your domain
# wbinfo -P-Display details on remote ADS server
# net ads info-Display machine account details
# net ads status -U <domain_user>-Remove all Xinuos samba4 config files
# /opt/xinuos/sbin/setup-samba.sh -u See also
TA128149, "How to get started with samba4 on UnixWare 7 or OpenServer6 Definitive as standalone fileserver"