I’d just firewall the ports, but none of them are open to begin with. File sharing in Linux is pretty much the same as Windows (uses the same ports/protocols) and is called SAMBA. If it were installed, you would see a version under “Installed” if you ran apt-cache policy samba
. Similarly, you’d find all the ports open with the following commands:
nc -v localhost {139,445}
nc -vu localhost 13{7,8}
If you want to go all out, you might go through the list of well known ports and firewall everything related to Windows, Microsoft, MS, etc. Don’t forget NetBIOS.
Given you’re new, I’m sure firewalling isn’t necessarily an easy concept. iptables is not necessarily for the weak and a graphical tool may be a bit better. There’s documentation (admittedly a bit outdated) that suggests ufw
which is a heck of a lot easier than iptables
, but still a command line program. I’ve never used it, but you might want to check into fwbuilder
which, unlike gufw
(which is also weird as it’s a frontend to a frontend), uses the Qt toolkit for graphics so it won’t require a bunch of extra dependencies in Lubuntu > 18.04.
Whatever program you decide (unless it’s iptables
or ufw
which are installed by default), you’ll need to install it. Use Muon (or if you’re on 18.04, Synaptic) since Discover doesn’t necessarily list everything. Alternately, you can sudo apt install <package>
e.g. sudo apt install fwbuilder
.
Now while that answers your immediate question, I’m not sure it will keep the network manager from knowing you’ve got another device connected. Assuming they have total control over the network, they has access to your IP address (and if they’re keeping track of all of them, they’ll see an extra one), MAC address (your network card’s device ID basically, though you can spoof this), and all the packets going back and forth across the network, which can easily be inspected. The last one is the most problematic. You could use something like a VPN (easier to screw up unless you have a very reliable VPN service and know what you’re doing) or Tor to anonymize your traffic, but even in the latter case, they would still know you were using Tor, which would be extremely suspicious. Worse yet, if this is their machine, they can do whatever they want with it including using various forms of tracking. tl;dr you’re probably going to get busted.