Internet Services  «Prev  Next»

Lesson 7Configuring port names
ObjectiveConfigure port names.

Configuring Port Names

Once you have decided to create a name for a port, you need to edit the /etc/services file. To edit this file:
  1. Open /etc/services in an editor, such as vi or pico.
  2. Find where the entry should go in the file. Notice that as you scroll down through the file, the port numbers increase. You should put your new entry so that port numbers remain sorted.
  3. Insert the port name, number and protocol, any aliases, and a comment.

View the SlideShow below to see the process of inserting a new entry into the /etc/services file.
1) Configure Port Names 1 2) Configure Port Names 2 3) Configure Port Names 3 4) Configure Port Names 4

Program 1 Program 2 Program 2 Program 2
Question: What line would you put in /etc/services for the foobar service running on UDP port 8888?
Correct answer:
foobar 8888/udp # the foobar service

Explanation:
The first field in /etc/services is the official service name. Next, you list the port and protocol using the "port/protocol" format. Finally, you list any aliases and a descriptive comment. Since you don't have any aliases, only a descriptive comment is required.

Port numbers to be configured in the latest version of Red Hat Linux

In the latest version of Red Hat Linux, version 8 as of September 2021, there are no specific port numbers that are pre-configured by default. However, the system administrator can configure any available port numbers for use by various services and applications running on the system. Common port numbers that may be configured on a Red Hat Linux system include:
  1. Port 22: This is the default port used for SSH (Secure Shell) connections.
  2. Port 80: This is the default port used for HTTP (Hypertext Transfer Protocol) web traffic.
  3. Port 443: This is the default port used for HTTPS (Hypertext Transfer Protocol Secure) web traffic.
  4. Port 25: This is the default port used for SMTP (Simple Mail Transfer Protocol) email traffic.
  5. Port 53: This is the default port used for DNS (Domain Name System) traffic.
  6. Port 3306: This is the default port used for MySQL database traffic.

The exact port numbers that are configured on a Red Hat Linux system will depend on the specific services and applications that are installed and in use on the system. The system administrator can configure port numbers by editing the system's firewall settings or the configuration files for individual services and applications.
The next lesson describes the function of the Domain Name System