LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Guys how do I close these open ports? All I have is a mobile service and spectrum Internet. (https://www.linuxquestions.org/questions/linux-security-4/guys-how-do-i-close-these-open-ports-all-i-have-is-a-mobile-service-and-spectrum-internet-4175731180/)

Theo1968 11-24-2023 11:03 AM

Guys how do I close these open ports? All I have is a mobile service and spectrum Internet.
 
Can someone please help me with this?

TB0ne 11-24-2023 11:09 AM

Quote:

Originally Posted by Theo1968 (Post 6466493)
Can someone please help me with this?

Since you give us no details at all, what do you think we'll be able to tell you??? You say "these open ports"....but don't say WHICH open ports, on what kind of system, running what version/distro of Linux, or what you're actually trying to accomplish. We can't guess.

teckk 11-24-2023 12:15 PM

Code:

ss -tunap
Examples:
Find process using port 8080
Code:

fuser 8080/tcp
lsof -i:8080

Close it
Code:

fuser -k 8080/tcp
lsof -w -n -i tcp:8080


JJJCR 11-29-2023 03:28 AM

what OS do you have? Ubuntu, Suse, Fedora or ?

Open ports, you mean in your Virtual Machine, Laptop, Desktop?

As other suggested, you can use:

ss command or the good old netstat

like: netstat -tulpn

How do you close it? Close the application that is listening to the specific port.

If you have open the port on the router, then you have to go back to the router and disable or remove the configuration

pan64 11-29-2023 04:24 AM

in general there are three ways:
1 find the process behind the port and stop it
2 use firewall
3 configure your router
4 switch off the host

sundialsvcs 11-29-2023 11:37 AM

You need to use a firewall. I happen to like to use the shorewall, which "knows how to utter the right incantations correctly." :)

You set up the rules that you want using a fairly-straightforward configuration file, and shorewall does the magic (correctly ...) for you. Very nice.

Aeterna 12-23-2023 01:20 PM

You are running some sort of web server. Whatever crappy distro. This should be closed by default.
Thumb of rule: all ports closed upon installation. Open as needed.
This is not your fault obviously. Unless you have been asked during the installation if you want to run specific services and you confirmed it. Nevertheless distro is crappy workstation/desktop has no need to run server by default.
I would change distro to something more sane.

Take look at running services and disable whatever you don't need. Too many web server possibilities to guess what this would be. Knowing distro may help.
Firewall should come later if at all.


All times are GMT -5. The time now is 11:20 AM.