How to secure File Sharing (Samba) on Ubuntu/Linux?

If you have multiple servers connecting to internet, these servers use Samba to share file with each other. Normally, you will Samba server for this purpose. After you install Samba & configure the server, all servers now can access file sharing now. But there is another issue, you realize that internet users can also access these files. How can we block internet users while still these servers sharing file with each other.

There are many solutions, but here is my proposal:
We create a virtual interface network, all our servers will have a 2nd virtual private interfaces , to do this you can add some lines to your /etc/network/interfaces

nano /etc/network/interfaces
auto eth0:1
iface eth0:1 inet static
        address 192.168.0.32
        netmask 255.255.255.0

When all servers have their own private interfaces, we can open samba configuration file and limit the file sharing server to bind to our private network

nano /etc/samba/smb.conf

Look for interaces command

Leave a Reply

Your email address will not be published. Required fields are marked *