In Windows, I go to command line and 'telnet ' to check the port. How to do the same in Unix?
It seems some people using 'tcpdump port ' commands. Is this monitoring the real time traffic? Thanks.
In Windows, I go to command line and 'telnet ' to check the port. How to do the same in Unix?
It seems some people using 'tcpdump port ' commands. Is this monitoring the real time traffic? Thanks.
nmap
is a great general-purpose tool for such things and much else.nmap host.domain.tld
(ornmap host
for a local machine, ornmap <ipaddr>
to check a machine by address not name) will list what common ports are open.nmap 192.168.23.1-254 -p 22,80,443
will scan a range of hosts by address to see if the TCP ports usually associated with SSH, HTTP and HTTPS are open.See
man nmap
for many more options - it is the kitchen sink of network checking tools.You may not have nmap installed at the moment, but it is in just about all distros standard repositories. For debian or ubuntu variants
aptitude install nmap
to install it, or find it in the GUI package manager of your choice. If it isn't available easily on your system, get it and more info from http://nmap.org/You could also just use the same
telnet
client technique that you are already familiar with as that is available too and usually installed in one of the default packages, butnmap
is a tool worth getting to know as it can be helpful for diagnosing network issues, just checking that things are as they should be, and so on. There are also a few decent graphical front-ends to it, if you would prefer to interact with it away from the command line.If you're using bash, then the man pages state that you could write to /dev/tcp/HostNameOrIP/port. I've used this a few times and if the remote port is open, then there is no response. If the system cannot connect to the remote port, then it states the reason
You can use
telnet
on a *nix machine, too.To test if port is accessible in Bash, you may use the following one-line command:
To check manually, use
telnet
command (similar as on Windows).