Книга: Fedora™ Unleashed, 2008 edition

Ports

Ports

Most servers on your network have more than one task. For example, web servers have to serve both standard and secure pages. You might also be running an FTP server on the same host. For this reason, applications are provided ports to use to make "direct" connections for specific software services. These ports help TCP/IP distinguish services so that data can get to the correct application. If you check the file /etc/services, you will see the common ports and their usage. For example, for FTP, HTTP, and Post Office Protocol (email retrieval server), you will see the following:

ftp   21/tcp
http  80/tcp www www-http # WorldWideWeb HTTP
pop3 110/tcp pop-3        # POP version 3

The ports defined in /etc/services in this example are 21 for FTP, 80 for HTTP, and 110 for POP3. Other common port assignments are 25 for Simple Mail Transport Protocol (SMTP) and 22 for Secure Shell (SSH) remote login. Note that these ports are not set in stone, and you can set up your server to respond to different ports. For example, although port 22 is listed in /etc/services as a common default for SSH, the sshd server can be configured to listen on a different port if you edit its configuration file /etc/ssh/sshd_config. The default setting (commented out with a pound sign) looks like this:

#Port 22

Edit the entry to use a different port, making sure to select an unused port number, such as this:

Port 2224

Save your changes, and then restart the sshd server. (Refer to Chapter 11, "Automating Tasks," to see how to restart a service.) Remote users must now access the host through port 2224, which can be done using ssh's -p (port) option like so:

$ ssh -p 2224 remote_host_name_or_IP

Оглавление книги


Генерация: 0.041. Запросов К БД/Cache: 0 / 0
поделиться
Вверх Вниз