Today would be the quick one. Since recently I have the need to share files between Mac, Windows and Linux in my homelab environment and I don’t have the NAS in it. I did a quick research and use Samba as my file sharing server. I quickly wrote this one for my long term memory.
Installation and SetUp
The first think we need to do is to install Samba on our Linux platform. Samba is the well-known software and there is already the package in the repository on the most Linux operating system. Mine is the Ubuntu and we can use the following command to install Samba.
# apt update
# apt install samba
Once Samba is on your system, we have to configure it. The first thing is to create one folder for file sharing. My case is to create one data folder under my home directory.
$ mkdir /home/jieliau/data/
After this, we have to add this folder configuration into the Samba config file: /etc/samba/smb.conf. Please add the following section into the smb.conf file.
[Sharing]
comment — Sharing data across multiple systems
path = /home/jieliau/data
read only = no
browsable = yes
Once above is done, please restart the samba service.
# systemctl restart smbd
Since Samba doesn’t use the system account password, we have to set up the Samab password for the user account. Please use the following command to add usename and password for Samba.
# smbpasswd -a jieliau
And then, our Samba is good to go. I will note how to connect from Mac and Windows.
Connect to Samba from MacOS
On MacOS, open one Finder and click Go → Connect to Server. After this, the system will prompt you to input ip address and username/password. Once you fill in the needed information, you could choose what folder you would like to connect. Once connect successfully, you are good to go. Please check the following screenshot.
Connect Samba from Windows
Connect from Windows platform is pretty straightforward. Login to you r Windows platform and open one File Explorer, and on the navigation bar, type into this: \\ipaddress\, and you enter the correct username and password, then you’re good to go on Windows platform. Please see the following.
Conclusion
Obviously, this is the quickest and easiest way to setup one file sharing server across multiple different OS platform. And as promised, today is really a quick one. I hope you enjoy it and help you in any way.