Howdy, Stranger!

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

Sign In with OpenID
Advertise on LowEndTalk.com

In this Discussion

How do I check if a port is open

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

  • jarlandjarland Administrator

    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 Member
    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

    'When someone says its free, know that someone else paid the price for it'

    UptimeTrack Free website and server monitoring! Get 10 free monitors today!

    WHM Superb Energize your cPanel with Radio Streaming, Voice Conferencing and more!

  • 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

    vpsdash.com - Tips and tricks in life, information and technology news to get things done

  • rskrsk Member, 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

  • miTgiBmiTgiB Member, Provider

    lsof -i:port number

    Hostigation High Resource Hosting - SolusVM KVM VPS / Proxmox OpenVZ VPS- Low Cost Comodo SSL Certificates
  • nmap -p xx hostname

    [email protected]:~$ 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
    

    SonicGlass 11 Locations- Amsterdam, Atlanta, Denver, Los Angeles, , Milan,
    SonicBoxes.com - VPS Tips, Tricks & Tutorials

  • 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

    Affordable VPS provider with Excellent Help-desk Support with 24/7 Live-chat

Sign In or Register to comment.