Red Hat Fedora Linux 3 Bible

With a domain name, a suitable Internet connection, and one or more static IP addresses, you need to prepare your server to share it on the Internet. In addition to choosing the types of services you want to offer, you must be more thoughtful about the security of your servers.

Configuring networking

Whether you’re configuring your computer for browsing the Web or offering up a server, procedures for creating network interfaces are very similar. See Chapters 15 and 16 for information on configuring TCP/IP for your computer. Following is a quick review of what you need to do to get a live connection to the Internet that’s suitable for your server:

After you set up your network interfaces and related information for your server, test the Internet connection by using the ping command, as I describe in Chapter 16. Next, if DNS is already configured for your domain, try to ping your server by name to see whether those in the outside world can reach you by name. Make sure that the static IP address that appears in response matches the static IP address that you were assigned.

Configuring servers

Some services are more appropriate for public exposure than others. You probably don’t want to offer your print server, for example, to anyone on the Internet. Similarly, file sharing with Samba or NFS isn’t appropriate to share publicly across the Internet.

If you’re creating your first public server, you may want to consider setting up at least the following basic types of servers:

Of course, you can share any type of server that you choose. Web, FTP, and mail servers, however, are designed for sharing publicly. The basic configuration for these types of servers isn’t that difficult. Securing and monitoring these — or any — public servers, however, requires special effort, as the following sections describe.

Managing security

Before you set up your Red Hat Linux system as a server, you can use it simply to make outgoing connections to the Internet. You can use your firewall (iptables) to close off the ports on your interface to the Internet (making your computer quite secure). Now, however, you need to open some of the ports on that interface to accept incoming requests. With more ports open, you must also become more consistent in monitoring those ports.

Opening your firewall

Making your server public doesn’t mean leaving your computer wide open. By using firewall rules, you can set your computer to allow outsiders to open connections to certain ports and block requests on other ports. Assuming that you set up your firewall to block incoming connections, here’s a list of services (and the associated port numbers) that you may want to consider accepting through your firewall from your external interface to the Internet:

To see which ports are assigned to which services by default, refer to the /etc/services file. In most cases, a configuration file for a service indicates the default port number the service listens on. One way of making a service more private is to change the port number that a service listens on. Then the user must know to ask for the service at that particular port.

Chapter 14 describes how to change your firewall to accept requests for these services. I start with the iptables example in that chapter when I create the DNS example later in this chapter. You can use that description as a model for setting up a firewall to go with DNS. In the DNS example, you have separate computers for mail, FTP, and Web services. For a low-volume server, however, you can have them all on the same computer.

Checking logs and system files

By making your servers public, you also make them more open to attacks. Although firewalls are a good first line of defense, you still need to watch the activity on those ports that you leave open. A consistent program of monitoring traffic and checking changes to your server, therefore, becomes more critical. The following are a few techniques that you can use to help secure your servers:

I describe these and other security techniques in Chapter 14.

Keeping up with updates

You can expect to find and correct security breaches continuously. You must keep up with software updates that are published to plug security holes. Although some of these updates address theoretical security problems, others are created in response to real break-ins or denial- of-service attacks that are known to exploit weaknesses in the components that come with your operating system.

For Red Hat Enterprise Linux systems, using the Red Hat Network (and its up2date facility) is the best way of getting security updates on a timely basis that are tailored for Red Hat Linux. For Fedora Linux, you can use up2date or yum to download and install updates from Fedora mirror sites that carry those updates (see Chapter 5 for information on using yum). You should also check CERT and other organizations (which I describe in Chapter 14) for security alerts.

After your server is secure and correctly configured, your last step is to start the server on the Internet with a domain name that points to it. Either ask your service provider to configure DNS for you, or set up your own DNS server, as I describe in the following section.

Категории