Skip to content

Instantly share code, notes, and snippets.

@rusllonrails
Created May 29, 2015 12:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rusllonrails/492c343aea50ab613a4c to your computer and use it in GitHub Desktop.
Save rusllonrails/492c343aea50ab613a4c to your computer and use it in GitHub Desktop.
Ubuntu Ports
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