Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


How do I check if a port is open
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

How do I check if a port is open

svgnamysvgnamy Member
edited October 2012 in Help

I am installing ssl certificates on a few of my vps. I've already installed two and everything works great. those vps are on debian. I have a vps on centos but when I install the ssl and test it, I get a 102 connection error in chrome.

I think my configuration is correct, but I want to see if the ssl port is open. the tool I found on Google says port 80 was closed so I figured I couldn't trust it.

anyone know how I can check if a port is open?

Comments

  • jarjar Patron Provider, Top Host, Veteran

    netstat is your best friend :)

  • luxorluxor Member
    edited October 2012

    When can't test them directly from any of my other machines (telnet, hping3, nc, etc.) I use the online check of Gibson Research, ShieldsUP!

    There you can test directly common ports or custom groups of ports also. It's quite handy.

    Edit: Oh! If you get a 102 error then I think that should be open since a 1xx error is informational, but jarland is right that netstat -ln is your command. But don't forget the firewall. ;)

  • risharderisharde Patron Provider, Veteran
    edited October 2012

    Try my simple port check tool, SSL or in this case HTTPS I think would be port 443
    http://www.risharde.com/portcheckutility.html
    You'll have to visit the website while on the VPS you want to check btw.
    Good luck

  • DamianDamian Member
    edited October 2012

    netstat -ln. If it shows up in the list, something is accepting connections for it.

    You can grep for your :portnumber too, if you have a lot of connections open.

  • cosmicgatecosmicgate Member
    edited October 2012

    Netstat -ln | grep portno

  • rskrsk Member, Patron Provider

    the good old way, telnet :)

    telnet [ip of host] [port]

    in cmd

    But if you want to see from the vps/server itself, then ye netstat is your friend.

    regards,
    R. Alkhaili

  • telnet targetipadddress 443 .. (443 is the default port for SSL) from ur source machine

    If u get something like escape character .. it means your SSL port is open.. however if it says connecting .. for long time . it means SSL port is closed

  • lsof -i:port number

  • nmap -p xx hostname

    nunim@numdesk:~$ nmap -p 80 google.com
    
    Starting Nmap 5.21 ( http://nmap.org ) at 2012-10-14 22:18 EDT
    Nmap scan report for google.com (74.125.227.130)
    Host is up (0.059s latency).
    Hostname google.com resolves to 11 IPs. Only scanned 74.125.227.130
    rDNS record for 74.125.227.130: dfw06s17-in-f2.1e100.net
    PORT   STATE SERVICE
    80/tcp open  http
    
    Nmap done: 1 IP address (1 host up) scanned in 0.36 seconds
    
  • great thanks. nmap worked.
    It shows the port as closed. I don't know how to open it. My firewall (iptables has been stopped) I'm wondering how to open a port that I didn't close. I'm using centos with lnmp installation script.

    Does anyone know how to open the port?

  • To open port via iptables you can use the command as :-

    iptables -I INPUT -p tcp --dport 25 -j ACCEPT

    iptables -I OUTPUT -p tcp --dport 25 -j ACCEPT

    /etc/init.d/iptables save

    /etc/init.d/iptables restart

Sign In or Register to comment.