CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/test/ldap/samba-ad-run.sh
Views: 1904
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