Ghamura

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

  1. 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
    

    (tcp is the protocol nearly all of these use. -w matches whole words only, so 22/tcp doesn't also match 122/tcp.)

    Which service normally listens on port 25?

5 more steps after this one

Which service normally listens on port 25?
Practice lab for "Ports and services". Type commands here and press Enter. Run help to list them.