I have a netbook running Lubuntu 16.04 with two External HDD serving as a Home Server. I already mapped it into my Windows computers over my home network but I would like to map it over the internet in a different machine on my office. Is that possible?
1 Answer
Yes. An easy method to map the device under samba. The device being internal or external doesn't make any difference. The criterion is that you can access the drive on your Linux box for sharing.
An example of Samba configuration is (/etc/samba/smb.conf):
[SharedDrive] comment = Shared External Drive path = /media/myexternaldrive writeable = yes browseable = yes valid users = user1, user2Make sure the external drive is available at boot time when the samba configuration will start.
An fstab entry is (/etc/fstab):
UUID="60292932-ae7d-4676-8f0f-7c319cb66fee" /media/myexternaldrive ext4 defaults 0 0The path entry smb.conf file is the mounted point of your external drive. The valid users are usernames on the linux machine. You would use sudo smbpasswd [username] -a to add the user to the samba permissions list.
The /etc/fstab entry is the UUID of the external drive and the mount point.
From Windows browse or map the drive:
There are many ways of adding file shares to Windows. You can do this simply by opening up your Windows file browserand putting the IP address or hostname of the Ubuntu machine, in this format: \\192.168.1.100\. This will list all your shared devices from the Ubuntu machine. Double click on the share you want and answer the username and password you have provided in the configurations above.
You can also right click on the shared resource and click map network drive to assign a drive letter to the device.
Making your Ubuntu visible from outside your local network
You will have to configure your router to forward the port for your Samba server to your Ubuntu computer. The default ports are TCP ports 139 and 445. The UDP defaults are UDP ports 137 and 138.
The port forwarding in most routers will be found under the Security group. On a Linksys router (Linksys Smart Wi-Fi), you can get to it by:
Click Security -> Apps and Gaming -> Port ForwardingYou will find some similar wordings in most Routers. You might have to look up port forwarding in your Router's manual.
You can find the IP address of your ubuntu computer either by browsing your router's configuration or by running this on the commandline:
hostname -I 18