Created
May 29, 2015 12:06
-
-
Save rusllonrails/492c343aea50ab613a4c to your computer and use it in GitHub Desktop.
Ubuntu Ports
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) see the list of opened ports | |
``` | |
$ netstat -ntlp | grep LISTEN | |
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN - | |
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN - | |
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN - | |
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN - | |
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN - | |
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN - | |
tcp 0 0 127.0.0.1:5433 0.0.0.0:* LISTEN - | |
tcp6 0 0 :::9200 :::* LISTEN - | |
tcp6 0 0 :::80 :::* LISTEN - | |
tcp6 0 0 :::9300 :::* LISTEN - | |
tcp6 0 0 ::1:631 :::* LISTEN - | |
tcp6 0 0 :::443 :::* LISTEN - | |
``` | |
2) Search in opened ports: | |
``` | |
$ sudo netstat -ntlp | grep :9200 | |
tcp6 0 0 :::9200 :::* LISTEN 3457/java | |
$ sudo netstat -ntlp | grep :5984 | |
$ | |
``` | |
3) Configure ports: | |
``` | |
sudo iptables -A INPUT -p tcp -i eth0 --dport 5984 -m state --state NEW -j ACCEPT | |
sudo iptables -A INPUT -p tcp --dport 5984 -j ACCEPT | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment