On Ubuntu
Open the terminal and run:
sudo apt update
sudo apt install samba
sudo nano /etc/samba/smb.conf
At the end of the file, add the following lines:
[sambashare]
comment = Samba on Ubuntu
path = /home/username/sambashare
read only = no
browsable = yes
Restart samba
sudo service smbd restart
Update firewall rules to allow Samba traffic:
sudo ufw allow samba
Set the samba password for the Ubuntu user
sudo smbpasswd -a username
On Mac:
Open finder and press COMMAND+k, this will open the window “Connect to server”, enter the URL:
smb://server-ip/sambashare