LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 11-24-2023, 11:03 AM   #1
Theo1968
LQ Newbie
 
Registered: Nov 2023
Posts: 1

Rep: Reputation: 0
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?
 
Old 11-24-2023, 11:09 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,710

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by Theo1968 View Post
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.
 
Old 11-24-2023, 12:15 PM   #3
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,146
Blog Entries: 6

Rep: Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834
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
 
1 members found this post helpful.
Old 11-29-2023, 03:28 AM   #4
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,162

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
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
 
Old 11-29-2023, 04:24 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,976

Rep: Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337
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
 
Old 11-29-2023, 11:37 AM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,679
Blog Entries: 4

Rep: Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947
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.
 
Old 12-23-2023, 01:20 PM   #7
Aeterna
Senior Member
 
Registered: Aug 2017
Location: Terra Mater
Distribution: VM Host: Slackware-current, VM Guests: Artix, Venom, antiX, Gentoo, FreeBSD, OpenBSD, OpenIndiana
Posts: 1,011

Rep: Reputation: Disabled
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.

Last edited by Aeterna; 12-23-2023 at 01:58 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] What ports are really open & can I close all but 80 & 443 nix84 Fedora 8 10-26-2015 12:00 PM
open ports for utorrent using iptables n close smpt to that ports shtorrent00 Linux - Networking 2 09-30-2008 03:34 PM
Which of these ports can I close? buddhahat Linux - Security 6 06-13-2005 07:40 AM
Do i need to have these ports open? dimgr Linux - Security 3 01-19-2005 05:34 PM
Newbie here: Are these ports ok to have open? mymojo Linux - Security 7 10-20-2003 04:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 04:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration