Install Samba File Sharing Server on Ubiquiti Unifi Dream Machine Pro and Configure ( UDM Pro )

This time I want to share how to configure Samba server on Ubiquiti Unifi Dream Machine Pro ( UDM Pro ).
Samba is a program with a Client-Server protocol that bridges the process of providing services for sharing data, 
documents and resources between the UNIX Family operating system and the Microsoft Windows operating system. 
This application runs on the UNIX Family operating system platform.

Use at your own risk. Do not do this because you do everything at your own risk.

With this method you can install on Ubiquiti Unifi Dream Machine Pro and Configure ( UDM Pro )

It is necessary that you have SSH turned on on UDM Pro, if you haven't turned it on, you can do it in OS Settings, Console Settings, check SSH and set the desired password... Username for ssh is root

01. Frstu instalasi paket necessary accessories and samba.

sudo apt update
sudo apt install mc
sudo apt install nano
sudo apt install samba samba-common-bin

02. Create a directory that you will share.

sudo mkdir /volume1/smb

(It could be a disk in your server.)

03. Then give Read-Write access to the folder.

sudo chmod 777 -R /volume1/smb

04. Create a new user that will be used for folder sharing.

sudo useradd nick

05. Give the password for the user that has been created.

sudo smbpasswd -a nick

Enter the password you want to use

06. Create the samba group.

sudo groupadd samba

07. And add this user to the samba group.

sudo gpasswd -a nick samba

08. The samba group needs to have read, write and execute permission on the shared folder. 
You can grant these permissions by executing the following command.

sudo chown -R nick:root /volume1/smb

09. After that configure the samba filea.

sudo nano /etc/samba/smb.conf

add:

# Change this to the workgroup/NT-domain name your Samba server will part of
   workgroup = WORKGROUP

# The name of your Samba server
   netbios name = UDMPro

# Samba min and max protokol
   server min protocol = NT1
   server max protocol = SMB3_11
   client lanman auth = yes
   ntlm auth = yes

# The specific set of interfaces / networks to bind t
    interfaces = 192.168.1.0/24

#Then on the bottom line add the following script

[SMB]
path = /volume1/smb
browseable = yes
guest ok = no
writable = yes
valid users = @samba

10. Restart smbd and nmbd.

sudo systemctl restart smbd nmbd
sudo systemctl status smbd nmbd
sudo systemctl start smbd nmbd

11. Samba ports.

  • TCP 139: used for file and printer sharing and other operations.
  • TCP 445: the NetBIOS-less CIFS port.
  • UDP 137: used for NetBIOS network browsing.
  • UDP 138: used for NetBIOS name service.

12. To check which ports are open on your server.

netstat -tnl

---