-1

I have a vps server on Centos and I have installed a vnc server by this tutorial:

how-to-install-vnc-server-on-centos-6

Well the server is running but I can't connect to it, I have scanned by nmap and I cannot find the port 5901. I tried to disable iptables but I got nothing!

I have already added this line in ip tables and save/restart it but it doesn't work!

iptables -I INPUT 5 -m state --state NEW -m tcp -p tcp -m multiport --dports 5901:5903,6001:6003 -j ACCEPT

Amarnath Balasubramanian
  • 9,300
  • 8
  • 34
  • 62
Simo
  • 67
  • 1
  • 8

1 Answers1

0

Try this iptables rules 1) is not secured connection rules 2) is secured and only connect with your given ip address *just replace the "192.168.10.0/24" with you IP range

1)rules set

iptables -I INPUT -p tcp --dport 5901 -j ACCEPT
iptables -I INPUT -p tcp --dport 6001 -j ACCEPT

2)rules set

iptables -I INPUT -p tcp --dport 5901 -j REJECT
iptables -I INPUT -p tcp --dport 6001 -j REJECT

iptables -I INPUT -p tcp --dport 5901 -s 192.168.10.0/24 -j ACCEPT
iptables -I INPUT -p tcp --dport 6001 -s 192.168.10.0/24 -j ACCEPT
srikantin
  • 1
  • 1