A Comprehensive Guide to FreeBSD

This is a Comprehensive Guide to Setting up a FreeBSD Server.

If you have any questions that you don't see addressed by this page. Please send any comments to fbsd-book@vmunix.com

Contents

Part 1.   System Administration

:
System Administration

1.  Setting up Printing Services
2.  User Administration
3.  System Administration

1.   Setting up Printing Services

There are three steps to setting up printing services:

  1. Edit the /etc/printcap and make an entry for the printer.

  2. Create a spool directory for lpd to store print jobs in.

  3. Start the line printer daemon lpd

Information about what printers are available to print from is contained in the file /etc/printcap. FreeBSD can print to printers connected to any valid port on the server, both parallel and serial. It can also print to any TCP/IP capable printer, such as those attached to other FreeBSD Boxes, and those attached to network printing devices, like Jet Direct cards.

Here is the standard /etc/printcap file:

#	@(#)printcap	5.3 (Berkeley) 6/30/90
# $Id: printcap,v 1.5 1996/10/13 16:52:33 joerg Exp $

#
# This enables a simple local "raw" printer, hooked up to the first
# parallel port.  No kind of filtering is done, so everything you
# pass to the "lpr" command will be printed unmodified.
#
# Remember, for further print queues you're going to add, you have to
# chose different spool directories (the "sd" capability below),
# otherwise you will greatly confuse lpd.
#
# For some advanced printing, have a look at the "apsfilter" package.
# It plugs into the lpd system, allowing you to print a variety of
# different file types by converting everything to PostScript(tm)
# format.  If you don't have a PostScript(tm) printer, don't panic,
# but do also install the "ghostscript" package.
#
# Do also refer to section 7 (Printing) of the handbook.  A local copy
# can be found under /usr/share/doc/handbook/handbook.{html,latin1}.
#
lp|local line printer:\
	:lp=/dev/lpt0:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:
#
# Sample remote printer.  The physical printer is on machine "lphost".
# NB: you cannot perform any kind of local filtering directly.  If
# you need local filters (e.g. LF -> CR-LF conversion for HP printers),
# create a filter script that recursively calls lpd with another -P
# argument after filtering.
#
#remote|sample remote printer:\
#	:rm=lphost:sd=/var/spool/output/lphost:lf=/var/log/lpd-errs:

The line

lp|local line printer:\
	:lp=/dev/lpt0:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:

from the above file, enables the default generic printer attached to /dev/lpt0. (Same as LPT1 on DOS systems)

For a printer to print, it needs a spool directory, or a place to temporarily store the file it is printing. This is sometimes called a queue; a print queue. When a print job is sent, but cannot be printed, it will be placed in this directory as a file. As soon as the printer is available, it will be sent to the printer. The spool directory in the example above is /var/spool/output/lpd

Note:

Post script printers are just like regular printers. Nothing special is required to set them up. Setting up a Non-post script printer to accept post script documents requires the a2ps or apsfilter package from the ports/packages collection

Also reference the man pages for: lpd lpr lpc pr

2.   User Administration

2.1.  Deleting Old Users
2.2.  Moving Home Directories
2.3.  vipw; chpass;
2.4.  Managing Groups; /etc/group

2.1.   Deleting Old Users

Deleting users in FreeBSD is super simple thanks to the handy program rmuser. All you do is type rmuser username, where username is the name of the user who is about to be nuked.

rmuser basically does four things for you:

1. Removes the user's home directory, as it is defined in the password file. Usually, this will be /home/username.

2. Removes the user's mail spool. This is located in /var/mail/username

3. Removes the user from any groups they are present in. Groups are stored in /etc/group.

4. Removes the user from the password file, /etc/passwd

It's good to know the steps that are involved in cleansing a user from your system. If you're a system administrator, it will often be necessary to temporarily remove users from a system by preventing them from logging in. You can do this by simply editing the password file with vipw and placing a # at the front of their encrypted password. When you want to reinstate the user you just remove the # sign!

2.2.   Moving Home Directories

Not Yet Scheduled

2.3.   vipw; chpass;

Not Yet Scheduled

2.4.   Managing Groups; /etc/group

Not Yet Scheduled

3.   System Administration

3.1.  booting -c or -s
3.2.  File Systems; mount; fsck; fdisk; umount
3.3.  MAKEDEV; tar; cron;

3.1.   booting -c or -s

Not Yet Scheduled

3.2.   File Systems; mount; fsck; fdisk; umount

Not Yet Scheduled

3.3.   MAKEDEV; tar; cron;

Not Yet Scheduled