Can I monitor connections to open ports?
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Can I monitor connections to open ports?
I block all ports in my firewall, except those necessary for visiting websites.
Is there a way to monitor what ports a program tries to use so I can open them?
Thanks for the help.
Is there a way to monitor what ports a program tries to use so I can open them?
Thanks for the help.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Can I monitor connections to open ports?
i don't understand why you need open ports for websites. the only ports i allow are for file transfers with nitroshare and dukto which i share files through the wireless router.VoxelMints wrote: ⤴Tue Jan 15, 2019 6:44 pm I block all ports in my firewall, except those necessary for visiting websites.
Thanks for the help.
which websites need open ports?
also you'll find out that then may be closed or undetected. go to https://www.grc.com/x/ne.dll?bh0bkyd2 click proceed, then enter a range of ports to test for open/closed status. under You may select any service from among those listed above . . . put a range of ports that includes your open something like 34560-34570 (the site will only test 64 ports at a time. 10 is good enough in the range 60 would take too long to confirm
Re: Can I monitor connections to open ports?
It seems I struggle with wording my questions clearly. That's my fault.
I have Incoming and Outgoing connections set to reject. I open ports 53 for DNS, and 443 for HTTPS so I'm able to visit websites.
I decided to drop the idea, it was proving too difficult to open ports for individual programs with restricted firewall settings like mine. I'll try the suggestions mentioned here, Thanks for the help.
I have Incoming and Outgoing connections set to reject. I open ports 53 for DNS, and 443 for HTTPS so I'm able to visit websites.
I decided to drop the idea, it was proving too difficult to open ports for individual programs with restricted firewall settings like mine. I'll try the suggestions mentioned here, Thanks for the help.
Re: Can I monitor connections to open ports?
Hi VoxelMints,
I just read your post and the good replies to it. Here are my thoughts on this as well.
+1 for WharfRat's reply...
How to Check for Open Ports in Linux - Make Tech Easier
https://www.maketecheasier.com/check-open-ports-linux/
I have found it interesting and sometimes necessary to check what ports my system is using with the firewall turned off temporarily to improve my Internet security and to see what certain applications like some media servers are using so I can add firewall rules for ports they need to use so they will work properly (if they did not provide all the required firewall ports information).
Hope this helps ...
I just read your post and the good replies to it. Here are my thoughts on this as well.
+1 for WharfRat's reply...
You do not need to open (allow incoming, add firewall rules) on those ports for your system to work normally like visiting websites unless you are running your own DNS server or your own web server or web server apps. The typical user just needs to turn on (enable) the Linux firewall. If you add some Internet-enabled applications that require adding firewall rules they should say so in their instructions or want to access other computers on a network, or for accessing your computer remotely with certain applications, then you will have to add firewall rules.VoxelMints wrote:I open ports 53 for DNS, and 443 for HTTPS so I'm able to visit websites.
Not necessary. With the firewall enabled, all incoming is rejected by default and you need outgoing to access the Internet.VoxelMints wrote:I have Incoming and Outgoing connections set to reject.
How to Check for Open Ports in Linux - Make Tech Easier
https://www.maketecheasier.com/check-open-ports-linux/
Code: Select all
sudo netstat -atup
Hope this helps ...
Last edited by phd21 on Wed Jan 16, 2019 2:44 pm, edited 1 time in total.
Phd21: Mint 20 Cinnamon & KDE Neon 64-bit Awesome OS's, Dell Inspiron I5 7000 (7573, quad core i5-8250U ) 2 in 1 touch screen
Re: Can I monitor connections to open ports?
Yes, I allow ports 53, and 443 only outgoing access, and it works fine. I decided to set outgoing connections to "allow" on a per application basis as a solution. I'm still considering the advice mentioned here though.phd21 wrote: ⤴Wed Jan 16, 2019 1:09 pmYou do not need to open (allow incoming, add firewall rules) on those ports for your system to work normally like visiting websites unless you are running your own DNS server or your own web server or web server apps. The typical user just needs to turn on (enable) the Linux firewall. If you add some Internet-enabled applications that require adding firewall rules they should say so in their instructions or want to access other computers on a network, or for accessing your computer remotely with certain applications, then you will have to add firewall rules.VoxelMints wrote:I open ports 53 for DNS, and 443 for HTTPS so I'm able to visit websites.
Re: Can I monitor connections to open ports?
when you open gufw (firewall) you will see in the report tab what is using the internet connections.
Re: Can I monitor connections to open ports?
I noticed the report tab wouldn't show Firefox connected or it's open ports. It's probably because the ports Firefox uses were already opened. But it would be nice if it showed everything opening a port.
I'm very paranoid about knowing what process is using the internet. And I miss this functionality in Linux Mint so far.
I'm very paranoid about knowing what process is using the internet. And I miss this functionality in Linux Mint so far.
Re: Can I monitor connections to open ports?
Hi trytip, VoxelMints, etc...
To: VoxelMints: The firewall reports tab shows my Slimjet browser but not everything else I am using. And you still have the commands like "sudo netstat -atup".
Thanks. I never noticed that reports tab in the Linux firewall before and it even allows you to add a firewall rule for an application listed automatically entering in the port as well. I had to click its "pause" button so that it would stop continuously updating itself.trytip wrote:when you open gufw (firewall) you will see in the report tab what is using the internet connections.
To: VoxelMints: The firewall reports tab shows my Slimjet browser but not everything else I am using. And you still have the commands like "sudo netstat -atup".
Phd21: Mint 20 Cinnamon & KDE Neon 64-bit Awesome OS's, Dell Inspiron I5 7000 (7573, quad core i5-8250U ) 2 in 1 touch screen
Re: Can I monitor connections to open ports?
in Terminal (maximized to get a better output)
for all connections including local
Code: Select all
sudo netstat -atnp | grep ESTABLISHED | awk '{printf "%-25s %-10s %-25s %-20s\n",$7,$1,$4,$5}' | sed /^-/d | sed 's/\// /g'
Code: Select all
sudo netstat -atnp | grep "ESTABLISHED\|LISTEN" | awk '{printf "%-25s %-10s %-25s %-20s\n",$7,$1,$4,$5}' | sed /^-/d | sed 's/\// /g'
Re: Can I monitor connections to open ports?
I think there may be some Linux beginner confusion about Windows v Linux here, Linux doesn't leave unused network ports open by default like WIndows does. This is one of the reasons it's so much more secure than WIndows.
For example, I've done distro hopping on my old netbook in the past. A few times, after reinstalling I forgot to turn on the firewall at first. I did this for a month once. This is on a machine that I don't use at home, just out and about in cafe etc hotspots. I NEVER got hacked. How many milliseconds would that have taken in Windows?
For example, I've done distro hopping on my old netbook in the past. A few times, after reinstalling I forgot to turn on the firewall at first. I did this for a month once. This is on a machine that I don't use at home, just out and about in cafe etc hotspots. I NEVER got hacked. How many milliseconds would that have taken in Windows?
For every complex problem there is an answer that is clear, simple, and wrong - H. L. Mencken
Re: Can I monitor connections to open ports?
trytip wrote: ⤴Mon Jan 21, 2019 5:09 pm in Terminal (maximized to get a better output)for all connections including localCode: Select all
sudo netstat -atnp | grep ESTABLISHED | awk '{printf "%-25s %-10s %-25s %-20s\n",$7,$1,$4,$5}' | sed /^-/d | sed 's/\// /g'
Code: Select all
sudo netstat -atnp | grep "ESTABLISHED\|LISTEN" | awk '{printf "%-25s %-10s %-25s %-20s\n",$7,$1,$4,$5}' | sed /^-/d | sed 's/\// /g'
I can't seem to run netstat or lsof commands with sudo because I use a user account, not an admin account. Using an "admin" account means I need to log in with the same password that is used to make "sudo" system changes which makes me nervous.
I disabled Cups, and Avahi, I think I'm covered on the networking side. Samba is not installed by default.
Re: Can I monitor connections to open ports?
you can still run the command without sudo but you will only get connection info for the current user. the root connections won't be displayed.VoxelMints wrote: ⤴Tue Jan 22, 2019 5:07 pm I can't seem to run netstat or lsof commands with sudo because I use a user account, not an admin account. Using an "admin" account means I need to log in with the same password that is used to make "sudo" system changes which makes me nervous.
Code: Select all
netstat -atnp | grep "ESTABLISHED\|LISTEN" | awk '{printf "%-25s %-10s %-25s %-20s\n",$7,$1,$4,$5}' | sed /^-/d | sed 's/\// /g'
Re: Can I monitor connections to open ports?
Cool, thanks trytip.trytip wrote: ⤴Wed Jan 23, 2019 12:56 amyou can still run the command without sudo but you will only get connection info for the current user. the root connections won't be displayed.VoxelMints wrote: ⤴Tue Jan 22, 2019 5:07 pm I can't seem to run netstat or lsof commands with sudo because I use a user account, not an admin account. Using an "admin" account means I need to log in with the same password that is used to make "sudo" system changes which makes me nervous.Code: Select all
netstat -atnp | grep "ESTABLISHED\|LISTEN" | awk '{printf "%-25s %-10s %-25s %-20s\n",$7,$1,$4,$5}' | sed /^-/d | sed 's/\// /g'
Re: Can I monitor connections to open ports?
If I remember correctly with Mint 19 I used to open port 53, 443, and 80. And my programs connected fine.
Has anything changed with how Mint 19.1 handles program connections recently?
Has anything changed with how Mint 19.1 handles program connections recently?