Networking essentialsLesson 2 of 8
Ports and services
Explain what a port is, connect to one by hand with nc, and read what the service tells you about itself.
0 of 6 tasks · about 12 min
Step 1
Doors on a machine
One machine runs many programs that talk over the network: a web server, a mail server, SSH. To keep them apart, each connection goes to a port, a number from 1 to 65535. If the IP address is the building, the port is the door.
A program waiting for connections on a port is listening, and it is called a service. Common services have customary port numbers, listed in
/etc/services:grep -w 22/tcp /etc/services(
tcpis the protocol nearly all of these use.-wmatches whole words only, so22/tcpdoesn't also match122/tcp.)Which service normally listens on port 25?
5 more steps after this one
Practice lab for "Ports and services". Type commands here and press Enter. Run help to list them.