CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/test/ldap/samba-ad-run.sh
Views: 11766
1
#!/bin/bash
2
3
set -e
4
5
[ -f /var/lib/samba/.setup ] || {
6
>&2 echo "[ERROR] Samba is not setup yet, which should happen automatically. Look for errors!"
7
exit 127
8
}
9
10
cat << EOF > /var/lib/samba/private/smb.conf
11
# Global parameters
12
[global]
13
dns forwarder = 192.168.65.7
14
#server services = s3fs, rpc, nbt, wrepl, ldap, cldap, kdc, drepl, winbindd, ntp_signd, kcc, dnsupdate
15
server services = ldap
16
17
netbios name = LDAP
18
realm = LDAP.EXAMPLE.COM
19
server role = active directory domain controller
20
workgroup = DEV-AD
21
idmap_ldb:use rfc2307 = yes
22
ldap server require strong auth = no
23
allow dns updates = disabled
24
[sysvol]
25
path = /var/lib/samba/sysvol
26
read only = No
27
28
[netlogon]
29
path = /var/lib/samba/sysvol/ldap.example.com/scripts
30
read only = No
31
EOF
32
33
samba -i -s /var/lib/samba/private/smb.conf
34
35