TSF – Giải pháp IT toàn diện cho doanh nghiệp SMB | HCM

Configure SnipeIT LDAP and Auto Synchronization on Ubuntu Server

Snipe-IT is a powerful IT asset management system widely used by organizations worldwide.
In Snipe-IT P6, this article guides you through configuring LDAP integration on Ubuntu Server step by step.
You will learn how to connect Snipe-IT to Active Directory or LDAP, map user attributes, and verify authentication.
The guide also explains how to enable automatic user synchronization using the built-in scheduler.
This setup helps reduce manual user management and improves system accuracy.
Common LDAP synchronization errors and practical troubleshooting tips are also covered.
The content is ideal for IT Helpdesk, System Engineers, and Administrators.
If you are running Snipe-IT in a corporate environment, this is a must-read configuration guide.

DC: 192.168.16.186
Domain: tsf.local
Snipe: 192.168.16.208

SnipeIT Ubuntu

Step 1: Install extension Ldap

sudo apt update
sudo apt install php8.2-ldap

Restart web server
sudo systemctl restart apache2


Step 2: Join domain (LDAP)

#1: On DC: Create ldap user : snipe pass Abc@1234

#2: On Snipe: Set DNS DC

sudo nano /etc/netplan/50-cloud-init.yaml
sudo netplan apply

network:
version: 2
ethernets:
ens18:
dhcp4: no
addresses:
– 192.168.16.208/24
nameservers:
addresses:
– 192.168.16.186 #IP DC
– 8.8.8.8
routes:
– to: 0.0.0.0/0
via: 192.168.16.1


#3: Config ldap

Active Directory domain: tsf.local
Ldap server: ldap://tsf.local
Ldap Bind Username: snipe@tsf.local
Ldap Bind Password: Abc@1234
Base Bind DN: DC=tsf,DC=local
Ldap Filter: &(objectClass=person)
Ldap Authentication query: sAMAccountName=%username%

Step 3: Auto sync ldap

Run command
cd /var/www/snipe-it
sudo php8.2 artisan snipeit:ldap-sync

Crontab setup 1 minute/sync (In fact, depending on your needs, it takes about 30 minutes to set.)
sudo crontab -e
*/30 * * * * cd /var/www/snipe-it && /usr/bin/php8.2 artisan snipeit:ldap-sync >> /var/log/snipeit-ldap.log 2>&1