Question Ubuntu | how to turn off the firewall, or in better words, open every port

BlockModder

Distinguished
Jun 29, 2013
23
0
18,510
I'm at my the end of my rope with Ubuntu, I cannot get my ports to listen or open. I have tried every ufw command, I have tried turning ufw off, Ive tried disabling it. What I've discovered is that apparently ufw doesnt come pre-installed anymore because Linux/Ubuntu come by default with every port blocked/closed. I want to be done with this, how do I open every port, permanently, its being used for a server in my LAN, I dont need this for defense.

Long story short, I cannot get Samba or NoMachine to work because ports like 4000, 137 – 139 and 445(Samba) are not actually open no matter what I put into UFW. I did a UFW reset even, no dice. Its not the router, all of my windows machines have no issues, even the VM's that are on same server(using bridged connections and thus their own IP's).

Please, any advice welcome, I really dont want to have to uninstall Ubuntu, but so far its so buggy I dont think I can use it if commands dont affect it.
 
What commands are you using?

Show some examples and the resulting error codes, messages, etc..

Not a Ubuntu user per se but there seems to be quite a bit of information on the internet.

For example:

https://www.cyberciti.biz/faq/how-to-open-firewall-port-on-ubuntu-linux-12-04-14-04-lts/

https://www.slingacademy.com/articl...close-a-port-in-firewall-ufw/#google_vignette

Note: Just example links - not a recommendation or endorsement.
Sure, I used commands such as sudo ufw allow samba, sudo ufw allow 137, sudo ufw allow 4000(the port Im using for nomachine). Then if I go and do an nmap scan of my machine on those ports, they return as still closed which is wild to me. I feel like there is something I might be fundamentally missing about Ubuntus firewall/internet protection, but at the same time, considering the pure bugginess that I have experienced with Ubuntu, Im beginning to think I might need a reinstallation which also isnt happening. Ill pay for and install windows server 2019 or 2022 before I do that, Ubuntu took to long to setup as it is.
 
Update your post to include full system hardware specs. No windows OS installed - correct?

Just for the record: make and model router?

What version etc. of Unbutu? Source?

You used nmap.

What about ss and firewall?

Reference:

https://linuxconfig.org/how-to-check-for-open-ports-on-ubuntu-linux

Here is a link regarding the firewall.

https://linuxize.com/post/how-to-setup-a-firewall-with-ufw-on-ubuntu-20-04/

https://phoenixnap.com/kb/configure-firewall-with-ufw-on-ubuntu

Out of my comfort zone (full disclosure) but I did note a reference that the UFW (firewall) needs to be installed and activated. Was that done?

And there will not be and there is no need for SSH which would be necessary for access from remote locations - correct?

From the phoenix link:

"Allow SSH Connections
If you plan to connect to your server from remote locations, you need to set up UFW to allow incoming SSH connections."

And if you make changes....

"After configuring the settings, disable and enable the UFW firewall for the changes to take effect". Is that being done?

= = = =

Simply thinking out loud now and perhaps some Ubuntu user will note some error of omission or commission on my part.

And post accordingly. No problem with that.