Windows
Linux
Networking
Windows telnet equivalent in Linux
Connects to a TCP host and port for simple protocol testing and troubleshooting.
Windows
→
telnet
Linux equivalents
nc host port
nc host port
nc host port
Overview
What this command does
Connects to a TCP host and port for simple protocol testing and troubleshooting.
Migration tip:
nc or netcat is a flexible replacement for Telnet when testing unencrypted TCP services.Practical tasks
Common use cases
Open a basic TCP connection
Connects to a TCP host and port for simple protocol testing and troubleshooting.
nc example.com 80
Connect to an HTTP port
nc -vz 192.168.1.10 22
Test whether SSH is open
nc -l 9000
Listen on TCP port 9000
Ready to run
Copyable Linux commands
Review paths, device names, package names and permissions before running any command.
nc example.com 80
nc -vz 192.168.1.10 22
nc -l 9000
Walkthrough
Examples with explanations
nc example.com 80 # open an interactive TCP connection
nc -vz 192.168.1.10 22 # scan one TCP port
nc -l 9000 # listen for a connection
Reference
Common options and variations
| Command or option | Use |
|---|---|
nc example.com 80 | Connect to an HTTP port |
nc -vz 192.168.1.10 22 | Test whether SSH is open |
nc -l 9000 | Listen on TCP port 9000 |
Distro differences
Debian/Ubuntu vs Fedora vs Arch
This command is the same on Debian/Ubuntu, Fedora and Arch Linux when the relevant tool is installed.
| Distribution | Package manager / base | Equivalent command | Difference to notice |
|---|---|---|---|
| Debian/Ubuntu | same command | nc host port |
Same command on this distribution. |
| Fedora | same command | nc host port |
Same command on this distribution. |
| Arch | same command | nc host port |
Same command on this distribution. |
Important
What to watch out for
Netcat traffic is normally unencrypted. Do not send passwords or sensitive data through a plain nc session.
Keep learning