<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Fabio.homework</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Fabio.homework"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Fabio.homework"/>
	<updated>2026-05-06T16:49:29Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Setting_up_a_samba-ad-dc&amp;diff=30821</id>
		<title>Setting up a samba-ad-dc</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Setting_up_a_samba-ad-dc&amp;diff=30821"/>
		<updated>2025-08-31T00:53:35Z</updated>

		<summary type="html">&lt;p&gt;Fabio.homework: /* Installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Notes =&lt;br /&gt;
&lt;br /&gt;
==== Active Directory Naming ====&lt;br /&gt;
&lt;br /&gt;
In all examples below, replace EXAMPLE with your NetBIOS domain name in caps, example.com with your DNS domain name, HOSTNAME with your system&#039;s host name in caps, and hostname with your system&#039;s host name.&lt;br /&gt;
&lt;br /&gt;
Refer to the [https://wiki.samba.org/index.php/Active_Directory_Naming_FAQ Active Directory naming FAQ] before choosing your domain name. &lt;br /&gt;
&lt;br /&gt;
==== MS-SNTP signing support ====&lt;br /&gt;
&lt;br /&gt;
AD Domain time sync requires MS-SNTP signing support, so be sure to check whether the NTP server you choose to deploy, does support it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Some of the NTP server versions available in the Alpine repositories (chrony, openntpd, busybox) do not currently support it. This will cause time sync issues for the domain, so be forewarned.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NTP implementations which do support MS-SNTP signing:&lt;br /&gt;
&lt;br /&gt;
* chrony (version &amp;gt;= 3.2) [https://pkgs.alpinelinux.org/packages?name=chrony&amp;amp;branch=edge&amp;amp;repo=&amp;amp;arch=&amp;amp;maintainer= Alpine package in edge] [https://git.tuxfamily.org/chrony/chrony.git/tag/?h=3.2 Source download v3.2] [https://git.tuxfamily.org/chrony/chrony.git/commit/?h=3.2&amp;amp;id=577aed484207addd054441ee8be7e6e30ce36cb2 - Source code commit]&lt;br /&gt;
* The ntp.org &amp;quot;ntpd&amp;quot; server [https://ntp.org/downloads.html - Download ntpd]&lt;br /&gt;
* Windows&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Chrony version 3.2 on Alpine 3.6.2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Uncomment and pin the edge/main repository in /etc/apk/repositories&lt;br /&gt;
&lt;br /&gt;
Note that the below URLs are invalid and used for illustrative purposes only. Replace with the valid repository URLs used by your installation.&lt;br /&gt;
&lt;br /&gt;
See [https://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management#Repository_pinning Package Repository Pinning] for further details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
https://mirror/alpine/v3.6/main&lt;br /&gt;
@edge https://mirror/alpine/edge/main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update the package index:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk update}}&lt;br /&gt;
&lt;br /&gt;
Upgrade chrony using the @edge tag&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add chrony chrony@edge}}&lt;br /&gt;
&lt;br /&gt;
Upgrade chrony-doc using the @edge tag&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add chrony-doc chrony-doc@edge}}&lt;br /&gt;
&lt;br /&gt;
Confirm that the installed version is from the edge repository:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|cat /etc/apk/world | grep chrony}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
chrony@edge&lt;br /&gt;
chrony-doc@edge&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart chronyd to use the newly upgraded version:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|/etc/init.d/chronyd restart}}&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
Install packages:&lt;br /&gt;
{{Cmd|apk add samba-dc krb5 py3-cryptography }}&lt;br /&gt;
&lt;br /&gt;
= Edit hosts file =&lt;br /&gt;
You need to modify your {{Path|/etc/hosts}} file to look similar to this.&lt;br /&gt;
&lt;br /&gt;
 127.0.0.1       localhost.localdomain localhost&lt;br /&gt;
 10.1.1.10       hostname.example.com hostname&lt;br /&gt;
&lt;br /&gt;
= Create smb.conf =&lt;br /&gt;
Alpine doesn&#039;t provide an example configuration file in the package so you&#039;ll need to create one at {{Path|/etc/samba/smb.conf}}. &lt;br /&gt;
&lt;br /&gt;
 [global]&lt;br /&gt;
         server role = domain controller&lt;br /&gt;
         workgroup = EXAMPLE&lt;br /&gt;
         realm = example.com&lt;br /&gt;
         netbios name = HOSTNAME&lt;br /&gt;
         passdb backend = samba4&lt;br /&gt;
         idmap_ldb:use rfc2307 = yes&lt;br /&gt;
 &lt;br /&gt;
 [netlogon]&lt;br /&gt;
         path = /var/lib/samba/sysvol/example.com/scripts&lt;br /&gt;
         read only = No&lt;br /&gt;
 &lt;br /&gt;
 [sysvol]&lt;br /&gt;
         path = /var/lib/samba/sysvol&lt;br /&gt;
         read only = No&lt;br /&gt;
&lt;br /&gt;
= Provision your Samba domain =&lt;br /&gt;
Answer the questions with your domain information:&lt;br /&gt;
{{Cmd|samba-tool domain provision --use-rfc2307 --interactive}}&lt;br /&gt;
Use the SAMBA_INTERNAL DNS option.&lt;br /&gt;
When asked for a forwarder IP, choose your internet DNS server. You can use your ISP or other public services (like Google) here.&lt;br /&gt;
&lt;br /&gt;
= Configure resolv.conf =&lt;br /&gt;
Modify your {{Path|/etc/resolv.conf}} to include your new domain as a search domain and point to itself as the first nameserver.&lt;br /&gt;
&lt;br /&gt;
 search example.com&lt;br /&gt;
 nameserver 10.1.1.10&lt;br /&gt;
&lt;br /&gt;
= Configure Kerberos =&lt;br /&gt;
You need to replace krb5.conf with a link to the one generated by samba.&lt;br /&gt;
{{Cmd|ln -sf /var/lib/samba/private/krb5.conf /etc/krb5.conf}}&lt;br /&gt;
&lt;br /&gt;
= Install new init script =&lt;br /&gt;
As of 3/31/2016 and Alpine 3.3.3, the included samba init script doesn&#039;t support starting it as a domain controller. Modify your {{Path|/etc/init.d/samba}} script like the one below.&lt;br /&gt;
&lt;br /&gt;
 #!/sbin/openrc-run&lt;br /&gt;
 &lt;br /&gt;
 extra_started_commands=&amp;quot;reload&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 DAEMON=${SVCNAME#samba.}&lt;br /&gt;
 SERVER_ROLE=`samba-tool testparm --parameter-name=&amp;quot;server role&amp;quot;  2&amp;gt;/dev/null | tail -1`&lt;br /&gt;
 if [ &amp;quot;$SERVER_ROLE&amp;quot; = &amp;quot;active directory domain controller&amp;quot; ]; then&lt;br /&gt;
         daemon_list=&amp;quot;samba&amp;quot;&lt;br /&gt;
 elif [ &amp;quot;$DAEMON&amp;quot; != &amp;quot;samba&amp;quot; ]; then&lt;br /&gt;
         daemon_list=$DAEMON&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 depend() {&lt;br /&gt;
         need net&lt;br /&gt;
         after firewall&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 start_samba() {&lt;br /&gt;
         mkdir -p /var/run/samba&lt;br /&gt;
         start-stop-daemon --start --quiet --exec /usr/sbin/samba --&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 stop_samba() {&lt;br /&gt;
         start-stop-daemon --stop --quiet --pidfile /var/run/samba/samba.pid&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 start_smbd() {&lt;br /&gt;
         start-stop-daemon --start --quiet --exec /usr/sbin/smbd -- \&lt;br /&gt;
                 ${smbd_options:-&amp;quot;-D&amp;quot;}&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 stop_smbd() {&lt;br /&gt;
         start-stop-daemon --stop --quiet --pidfile /var/run/samba/smbd.pid&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 start_nmbd() {&lt;br /&gt;
         start-stop-daemon --start --quiet --exec /usr/sbin/nmbd -- \&lt;br /&gt;
                 ${nmbd_options:-&amp;quot;-D&amp;quot;}&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 stop_nmbd() {&lt;br /&gt;
         start-stop-daemon --stop --quiet --pidfile /var/run/samba/nmbd.pid&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 start_winbindd() {&lt;br /&gt;
         start-stop-daemon --start --quiet --exec /usr/sbin/winbindd -- \&lt;br /&gt;
                 $winbindd_options&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 stop_winbindd() {&lt;br /&gt;
         start-stop-daemon --stop --quiet --pidfile /var/run/samba/winbindd.pid&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 start() {&lt;br /&gt;
         for i in $daemon_list; do&lt;br /&gt;
                 ebegin &amp;quot;Starting $i&amp;quot;&lt;br /&gt;
                 start_$i&lt;br /&gt;
                 eend $?&lt;br /&gt;
         done&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 stop() {&lt;br /&gt;
         for i in $daemon_list; do&lt;br /&gt;
                 ebegin &amp;quot;Stopping $i&amp;quot;&lt;br /&gt;
                 stop_$i&lt;br /&gt;
                 eend $?&lt;br /&gt;
         done&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 reload() {&lt;br /&gt;
         for i in $daemon_list; do&lt;br /&gt;
                 ebegin &amp;quot;Reloading $i&amp;quot;&lt;br /&gt;
                 killall -HUP $i&lt;br /&gt;
                 eend $?&lt;br /&gt;
         done&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
= Configure the Samba service =&lt;br /&gt;
Run this command to start the service on boot.&lt;br /&gt;
{{Cmd|rc-update add samba}}&lt;br /&gt;
&lt;br /&gt;
Run this command to start the service right now.&lt;br /&gt;
{{Cmd|rc-service samba start}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Printers]]&lt;br /&gt;
[[Category:Authentication]]&lt;/div&gt;</summary>
		<author><name>Fabio.homework</name></author>
	</entry>
</feed>