Home > Articles > Operating Systems, Server > Linux/UNIX/Open Source

Choosing Network Services During Installation

As noted earlier, Linux supports many network services. Your job is determining which ones you need. Network services come in two basic flavors:

  • Services that deliver information to clients for human consumption. For example, a Web server, which allows users to download documents and media.

  • Services that deliver information to clients or hosts for network and operational purposes. For example, Dynamic Host Configuration Protocol, which automatically sets up clients' network configuration.

Network services that provide people with data or functionality are generally not essential. Instead, they are privileges and niceties that you afford your users, and you'd profit by viewing them that way. Indeed, because almost every service you run will complicate system administration and security, the fewer you allow the better. Here are some nonessential services that provide people with data or functionality:

  • bootpd—A server that can implement the bootstrap protocol, which allows you to boot diskless clients from a server. During startup, a diskless client queries the server and discovers its IP address. It also loads any files specified by the server. (Typically, the server forwards a boot program.) Don't run bootpd if you don't need it.

  • fingerd—The finger server, which gathers personal information on specified users, including their username, real name, shell, directory, and office telephone number (if available). On request, fingerd forwards this information to anyone using a finger client. Here's an example of what fingerd returns:

  • Login name: unowen           In real life: U. N. Owen
    Directory: /home/unowen         Shell: /sbin/sh
    On since Feb 3 18:13:14 on pts/15 from ppp-208-19-49-133.samshacker.net
    Mail last read Wed Feb 3 18:01:12 1999
  • This isn't essential by any means. In fact, it might expose your users and your Linux server to unwanted invasions of privacy. Disable fingerd unless you have a good reason not to. To do so, comment it out in /etc/inet.d by placing a # symbol at the beginning of the finger definition line). Users of xinetd can either remove the server file from their /etc/xinetd.d directory, or set disable = yes within the service file.

  • ftpd—File Transfer Protocol (FTP), which provides standard file transfer over internetworks. Today, there's less reason to run an FTP server. The WWW has made it easy to distribute files using HTTP, which most users are more familiar with anyhow. If you are going to provide FTP services, see Chapter 11, "FTP Security."

  • httpd—The Hypertext Transfer Protocol server. This is your Web server. Without a doubt, you'll want to provide at least limited Web services. Check Chapter 14, "Web Server Security," for ways to tighten access control and general Web security.

  • nfs—Network File System, a system that allows you to transparently import files from or export file systems to remote hosts. These files appear and act as though they were installed on your local machine. NFS is useful in many situations. For example, if you're hosting Web servers for third parties (running a Web farm), you can run exports to a RAID server. That way, all user Web directories are actually stored on a single server, redundant and prepared for possible individual host failures. To users, who maintain their own Web pages, everything appears to be local when they telnet or FTP into their co-located box.

  • NFS has many other uses, too. However, if you don't need it, don't install or enable it. NFS has some security issues, even though secure NFS systems do exist. Learn more in Chapter 15, "Secure Web Protocols."

  • nntpd—Network News Transfer Protocol server. This is the Usenet news server. Today, most people get Usenet news from their ISP's feed, so there's little reason to run NNTP yourself.

  • rlogind—The rlogin (remote login) server. rlogin is an r service that allows users to conduct remote terminal sessions, much like telnet does. A major difference between rlogin and telnet is that rlogin allows users to set up passwordless access on trusted hosts with trusted users. You probably don't want this.

  • rshd—The remote shell (rsh) server. rsh allows users to execute commands on remote hosts running rshd. This is a member of the r services family (rsh, rlogin, and so on), which is a notorious security hazard. Carefully consider whether you need to provide such services.

  • talkd—The talk server. talk is an interactive chatting system for Linux that splits each user's screen in half. The top half echoes the requesting party's keystrokes, and the bottom echoes the responding party's keystrokes. Is this essential? Hardly. However, if your system is in-house (not wired to the Net), you might want to keep talk for quick interdepartmental communication.

  • telnetd—The telnet server. Although telnet can increase risk, it is indispensable for some administrative tasks, so you'll probably want it. Check Chapter 13, "Telnet and SSH Security," for ways to lock down telnet and keep it useful but safe.

  • sshd—The secure shell server. The Secure Shell Daemon provides a replacement to telnet that offers full traffic encryption. This is a good thing to keep around if you want to perform remote administration.

  • tftp—Trivial File Transfer Protocol (TFTP). TFTP is an antiquated means of transferring files. You probably don't need it.

These are just a few examples, Chapter 14 has a larger list with descriptions. A default installation could result in many more nonessential services cluttering up your system and eroding its security. For this reason, whenever possible, you should run a verbose installation and explicitly reject packages that you don't need.

Five Minutes to a More Secure System

After installing Linux, the first thing you should do is assess the services that are running on your computer. Linux starts services in one of two primary ways: by running them at boot time, or by a connection request occurring at the appropriate port.

inetd and xinetd

The first place to look for unnecessary services is in the /etc/inetd.conf file or /etc/xinetd.d directory. The inetd process is the Internet daemon. It listens on the appropriate port for a service request, and then starts the corresponding server to process the request. If you have a system that uses inetd, check your system for the presence of /etc/inetd.conf. A sample of the file contents are shown here:

#echo  stream tcp   nowait root  internal
#echo  dgram  udp   wait  root  internal
#discard    stream tcp   nowait root  internal
#discard    dgram  udp   wait  root  internal
#daytime    stream tcp   nowait root  internal
#daytime    dgram  udp   wait  root  internal
#chargen    stream tcp   nowait root  internal
#chargen    dgram  udp   wait  root  internal
#time  stream tcp   nowait root  internal
#time  dgram  udp   wait  root  internal
#
# These are standard services.
#
ftp   stream tcp   nowait root /usr/sbin/tcpd in.ftpd -l -a
#
# Pop and imap mail services et al
#
#pop-2  stream tcp   nowait root  /usr/sbin/tcpd ipop2d
#pop-3  stream tcp   nowait root  /usr/sbin/tcpd ipop3d
#imap  stream tcp   nowait root  /usr/sbin/tcpd imapd

Each line denotes a particular service that can be activated on your system. If a line in this file begins with a pound sign (#), it is disabled. Unless you are absolutely sure that you need a service, you can comment out any services that are currently enabled on your system. After making your changes, either reboot your system or reload the inetd configuration by finding the inetd process ID (ps ax | grep inetd), and then issuing the command kill -1 <inetd PID>.

If you've looked for the /etc/inetd.conf file and can't find one, you're probably running xinetd, an advanced replacement for the standard Internet daemon. Check the system for the presence of /etc/xinetd.conf. If it exists, open it.

service ntalk
{
    socket_type       = dgram
    wait          = yes
    user          = nobody
    group          = tty
    server         = /usr/sbin/in.ntalkd
}

Each of the xinetd services is configured in a block, as seen here. To disable a service, comment out the entire block, or add a line reading "disable=yes" to the block. Depending on your setup, your /etc/xinetd.conf file might include a line like this:

includedir /etc/xinetd.d

If you see such a line, xinetd will read the contents of that directory and look in each of the contained files for other service definitions. Typically a single service is defined for each file. To disable services on a system that uses this option, simply move the service files from the included directory (usually /etc/xinetd.d), or add the "disable=yes" line to the service file you want to incapacitate.

Runlevel Services

Runlevel services, rather than starting when requested, start when the system boots. These services are usually defined by creating a symbolic link between service start and stop files in /etc/rc.d/init.d and the runlevel directories /etc/rc.d/rc#.d, where the # varies between 0 and 6. (Unless you've modified your system, runlevel 3 is the standard text boot mode, whereas runlevel 5 is the graphical X Window startup.)

To view the services included on your system, list the /etc/rc.d/init.d directory:

[jray@bcdinc rc.d]$ ls /etc/rc.d/init.d/
anacron  functions keytable  network rawdevices single ypbind
apmd   gpm    killall  nfs   rhnsd    snmpd  yppasswdd
arpwatch halt    kudzu   nfslock rstatd   sshd  ypserv
atalk   httpd   linuxconf pcmcia  rusersd   syslog
atd    identd   lpd    portmap rwalld   webmin
crond   ipchains  named   pppoe  rwhod    xfs
dhcpd   kdcrotate netfs   random  sendmail  xinetd

To see which are running on your system, first determine the runlevel you're at. (Again, if you're in text mode, 3 is a good guess. If not, use 5.) Then list either the rc3.d (runlevel 3) or rc5.d (runlevel 5) directory:

[jray@bcdinc rc.d]$ ls /etc/rc.d/rc3.d
K00linuxconf K20rstatd   K60lpd   K87portmap  S40atd     S85gpm
K01kdcrotate K20rusersd  K65identd  K95kudzu   S50xinetd   S85httpd
K01pppoe   K20rwalld   K75netfs  K96pcmcia  S55named    S90crond
K03rhnsd   K20rwhod   K83ypbind  S08ipchains S55sshd    S91atalk
K05keytable  K34yppasswdd K84apmd   S10network  S56rawdevices S95anacron
K10xfs    K45arpwatch  K84ypserv  S12syslog  S65dhcpd    S99local
K20nfs    K50snmpd   K86nfslock S20random  S80sendmail  S99webmin

Files that are prefaced with a K are files used to safely shut down processes, whereas files with the S prefix are used to start files. The number preceding the service name determines the order in which services are started or stopped. To completely remove a service from the runlevel, just delete the links from the runlevel directory.

chkconfig

If you're more comfortable with a command-line tool, you can use chkconfig to show the what's in your current runlevel and to delete and add services. Additionally, chkconfig will also show the xinetd services enabled on your system. For example, to show the runlevel settings, type chkconfig --list:

[jray@bcdinc rc.d]$ chkconfig --list
anacron     0:off  1:off  2:on  3:on  4:on  5:on  6:off
httpd      0:off  1:off  2:off  3:on  4:on  5:on  6:off
apmd      0:off  1:off  2:on  3:off  4:on  5:on  6:off
syslog     0:off  1:off  2:on  3:on  4:on  5:on  6:off
crond      0:off  1:off  2:on  3:on  4:on  5:on  6:off
netfs      0:off  1:off  2:off  3:off  4:on  5:on  6:off
...
sendmail    0:off  1:off  2:on  3:on  4:on  5:on  6:off
snmpd      0:off  1:off  2:off  3:off  4:off  5:off  6:off
rhnsd      0:off  1:off  2:off  3:off  4:on  5:on  6:off
xinetd     0:off  1:off  2:off  3:on  4:on  5:on  6:off
ypbind     0:off  1:off  2:off  3:off  4:off  5:off  6:off
yppasswdd    0:off  1:off  2:off  3:off  4:off  5:off  6:off
ypserv     0:off  1:off  2:off  3:off  4:off  5:off  6:off
dhcpd      0:off  1:off  2:off  3:on  4:off  5:off  6:off
webmin     0:off  1:off  2:on  3:on  4:off  5:on  6:off
atalk      0:off  1:off  2:off  3:on  4:on  5:on  6:off
xinetd based services:
    imap:  on
    imaps: off
    ipop2: off
    ipop3: on
    pop3s: off

To delete a service from the runlevel or xinetd, use chkconfig --del <service name>. Similarly, you can add a service with chkconfig --add <service name>. This provides a clean interface to service management and is less prone to introducing errors into the system than editing the configuration files by hand.

Depending on your system, you might also have access to ntsysv, a Curses-based service editor. Users of KDE and GNOME also have runlevel editors built into their desktop systems. Personally, I find it easy to edit xinetd/inetd and runlevels manually.

If you plan to connect your machine to a network immediately upon installation, I highly recommend that you disable as many services as necessary before reading beyond this chapter. I've seen instances in which machines on open Internet connections have been hacked in less than an hour because they were not properly secured. Take your server's security seriously—it would be a shame if a hacker got to use your computer before you!

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020