This chapter describes basic information about how to perform common system administration tasks on your OpenLinux system. Although the information should be helpful for new Linux users, it is not intended to provide a comprehensive guide to the topics covered. In addition, you will find a table listing technical guides on the Caldera Systems Web site and the Linux online resources.
Understanding how the OpenLinux operating system starts up can be a great help in problem-solving, preparing for strong security, and simply understanding how things work on your system.
OpenLinux is based on a UNIX System V initialization system, so this process may be familiar to you if you have worked with other SysV UNIX systems.
After the Linux kernel is started by the LILO boot manager or Master Boot Program located in the Master Boot Record, the following steps occur, under the control of the Linux kernel:
For example, if run level 3 is specified, the services in directory /etc/rc.d/rc3.d are processed.
Among the programs generally started by the run level scripts is the initd super-server, which watches for traffic on the network ports defined by /etc/services and starts server programs when a request is received, according to the server specified in /etc/inetd.conf .
The virtual consoles defined by /etc/inittab are accessed on Alt+F1 through Alt+F6. These consoles each provide a character-based login, as if you were working from a dumb terminal. You can log in from these consoles using any valid user account, then switch between the consoles using the Alt+Fx key combinations.
If you are in the graphical system, you can switch to the other virtual consoles by pressing Ctrl+Alt+F x (F x is one of the keyboard function keys from F1 to F6, inclusive). Once you are in the character-mode consoles, use Alt+F x , . To switch back to the graphical system, press Alt+F7.
As mentioned previously, OpenLinux is a multi-user operating system. This means that multiple users can simultaneously access and use OpenLinux. This section explains how to set up and manage multiple user accounts.
To create a new user account on your system, use any of these methods:
In each case, follow the on-screen prompts to enter information about the user account you're creating.
The utilities passwd and usermod can be used to manage user accounts after they are created. You can alter passwords, expiration dates of passwords, default shells, and more. See the manual pages of each command for more information.
When you create a new user account, the information from the /etc/skel directory is copied into the new users home directory. This information includes basic startup scripts and configuration information.
As a security measure, most network services are managed by a protective program called a TCP wrapper. The protected services are those listed in the /etc/inetd.conf file which use the /usr/sbin/tcpd program. These services include, for example, FTP and Telnet access.
A sample line from the /etc/inetd.conf file is shown here:
ftp stream tcp nowait root /usr/sbin/tcpd in.ftpd -l -a
This line shows that the ftp service is maintained by the inetd program. Whenever a request for FTP service arrives on the port named for FTP in the /etc/services file, the tcpd program is started, with in.ftpd, the FTP server program, as a parameter.
By encapsulating (wrapping) network services using tcpd, you can control access to the service by configuring and maintaining the hosts.allow and hosts.deny files in the /etc directory.
These rules can include security based on
A sample /etc/hosts.allow file, when edited to allow access to services, might look like this:
ALL: mycompany.com .mycompany.com
This configuration allows all connections from mycompany.com and *.mycompany.com machines. It also allows the services talk, finger, and ftp to accept requests from all machines.
The tcpd program allows much more sophisticated access control, using a combination of the files /etc/hosts.allow and /etc/hosts.deny. Read the tcpd(8) and hosts_access(5) man pages for complete details.
KDE is installed with OpenLinux by default and is available to all users on the system.
The main KDE files are placed in the /opt/kde directory. The most important section of this directory is the share subdirectory. Its subdirectories include:
In addition to the system-wide KDE directories, each user's home directory contains two KDE-related directories which are created the first time that user starts KDE. These are:
This directory contains KDE Link files for all icons that appear on the user's Desktop
This hidden directory contains configuration information specific to the user and the applications that the user has launched.
All of the per-user information is contained in the ~/.kde/share subdirectory. The contents of this subdirectory mirror the contents of the /opt/kde/share subdirectory, except that in this case they are specific to a single user. The specific subdirectories include:
A single hidden file is also present in each user's home directory during and after each KDE session. This file, .kderc, contains information about the user's language preference, the status of open windows at the end of the last KDE session, and so forth.
The Apache Web server is automatically installed and configured when you install OpenLinux. This Web server is used for processing online help requests and online documentation within OpenLinux. You can easily use it as a Web server for other clients to browse documents from your system.
To check the status of the Web server, use the ps aux command and look for lines containing the httpd process. The httpd program is the Apache Web server.
Several files and subdirectories are used by the Web server:
NOTE: Two other configuration files, srm.conf and access.conf, are also included in the /etc/httpd/apache/conf directory. With the latest version of Apache, the configuration settings included in these files can all be placed in the httpd.conf file.
An FTP server is configured and running after a standard OpenLinux installation. You can use anonymous FTP to exchange files with your OpenLinux system via any FTP client, including a Web browser. To try this, enter this URL from any client that can access your Linux system over a network:
When you use this command, you are accessing the directory /home/ftp on your OpenLinux system. Any files that you place in the directory /home/ftp/pub are accessible by default to anonymous users who log in to your system using FTP.
You can also use FTP to access regular user accounts. Use a URL like this one:
ftp://username@linux_system_name/
You are prompted for a password before you see the files on the Linux system.
Several files located in the /etc directory define the configuration of the FTP server running on OpenLinux. Although the default configuration is fairly secure, you should review the configuration files carefully before using FTP openly on an Internet-connected OpenLinux server.
The following files are relevant to your FTP server:
OpenLinux includes the sendmail Mail Transfer Agent (MTA). This program makes your OpenLinux system a complete mail server.
You can check that the sendmail package is installed using this command:
Unfortunately, configuring sendmail can be challenging for any but the most rudimentary mail servers. The myriad capabilities and the obtuse configuration style of this program mean that you'll need to do some serious study if you want to have it perform securely and to the limits of its capabilities. Two execellent references are provided at the end of this section.
Two initial configuration files that you can refer to are the /etc/sendmail.cw file and the /etc/sendmail.cf file. Man pages for these files can give you some initial guidance.
One common sendmail configuration is to have a single machine act as a mail gateway for all the machines on your network.
For example, suppose that the main Internet gateway at your company, corp.com, handles all mail accounts. We can add the hostnames of other machines in the organization to the /etc/sendmail.cw file, in order to have mail sent to those machines captured by the main mail server corp.com. For example, we might add the following lines to sendmail.cw :
# sendmail.cw - include all aliases for your machine.
Then on the other machines (diamond, emerald and quartz), we would edit the /etc/sendmail.cf file to "masquerade" as corp.com when sending mail, and to forward any local mail processing to company.com. To do this, find the DH and DM lines in /etc/sendmail.cf and edit them:
# who gets all local email traffic ($R has precedence for unqualified names)
# who I masquerade as (null for no masquerading)
With this type of configuration, all mail sent will appear as if it were sent from corp.com and any mail sent to diamond.corp.com or the other hosts, will be delivered to corp.com.
OpenLinux includes support for a NetWare client, which you can obtain from Caldera Systems. This section describes some of the features of that client. You can download additional NetWare-related software from the Caldera Systems Web site.
NOTE: A NetWare NDS server is also available for Linux. See the Caldera Systems Web site for details.
To view NetWare resources on your network, change to the /NetWare directory of your OpenLinux system. From here, you can go to the NDS/ or the Bindery/ directory. Within the Bindery/ directory are subdirectories named for the Bindery servers on your network. Each server's subdirectory includes file-like objects that refer to volumes or objects on that Bindery servers. For example, users, groups, and printers.
Within the /NetWare/NDS directory are subdirectories named for the NDS Directory trees visible on your network. The name of each NDS Directory tree is synonymous with the [Root] object in that Directory tree. When you change to one of these directories, you see the top-level objects in that NDS Directory tree. You can continue to traverse deeper into the directory structure through layers of NDS container objects. Whenever a leaf object appears in the Directory tree (like a User object, or a Group object), the object appears as a file with the object's name.
Though these Bindery and NDS objects appear as subdirectories or files, they are managed like objects when you use the Desktop or command line utilities to view or manage your NetWare resources.
You can use the cd command in a terminal emulator, or a Directory window on the Desktop to locate any NetWare volume. The files on the NetWare volume can be used like any other files on your system. Any object can be examined by using the cat command to see its object type. For example, if a directory included an object named nwelch , the following command would print a summary of that object, including the fact that it is a User object:
Before you can use NetWare resources, you must log in to the NetWare tree or server you want to access using the nwlogin command and a valid NetWare username and password.
The following two tables describe the commands and graphical utilities that are available for accessing and managing the NetWare server or NDS tree once you have successfully logged in.
|
Set a disk space quota for a directory on a NetWare NDS server. |
||
|
Show the disk space quota for a directory on a NetWare NDS server. |
||
OpenLinux can be used as a powerful terminal server, allowing use by dumb terminals or modem connections. Dumb terminals are used when you have a character-based application that many users are accessing; modems provide access to your OpenLinux server via voice telephone lines. Setting up a terminal server for a least one modem line is usually the preliminary step to configuring a PPP server for dial-in access to your system.
Because Linux is not restricted in the number of users that it can support (except by your hardware capacity), you can connect as many terminal or modem devices to your OpenLinux system as you feel the speed of the system can support.
To configure a terminal server, you must
Defining the devices to use is simple if you are using the standard serial ports on your PC. If you need to add additional ports (such as a 256 port serial card), see the documentation included with your additional hardware for instructions and software to help you create the devices you need within Linux. A device name for each port should be available in the /dev directory.
To define a terminal device for the getty program, add a line to the /etc/gettytab file that defines the device characteristics. For many devices, you can simply duplicate an existing line with a new name.
For example, the VC entry (used for all Virtual Consoles) looks like this:
You can duplicate this line with a new name, such as MYTERM, and speed, 38400:
NOTE: To learn the meaning of each field in the gettytab entries, see the termcap man page. Both gettytab and termcap use the same format.
Finally, you must define how to initialize these terminal devices by adding them to the /etc/inittab file. By assigning each terminal a number, you can keep track of how each one is assigned in /etc/inittab.
The default getty section of /etc/inittab looks like this:
# Run gettys in standard runlevels
1:12345:respawn:/sbin/getty tty1 VC linux
2:2345:respawn:/sbin/getty tty2 VC linux
3:2345:respawn:/sbin/getty tty3 VC linux
4:2345:respawn:/sbin/getty tty4 VC linux
5:2345:respawn:/sbin/getty tty5 VC linux
6:2345:respawn:/sbin/getty tty6 VC linux
If you had a modem connected to serial port 1 (/dev/ttyS0), you would add a line like this to the end of the list:
7:2345:respawn:/sbin/getty ttyS0 MYTERM linux
Notice the following things about this new entry:
Once you have edited the necessary files, re-initialize the system to use the parameters you have entered using this command:
You are ready to test the devices to see that they respond with a login prompt.
NOTE: If you want users to immediately begin using a certain program after logging in, add that program name to their startup information in the /etc/passwd file. For example, instead of /bin/bash, change the default shell to /bin/bash -c salesprogram:
dtaylor:x:500:500:Danielle Taylor:/home/dtaylor:/bin/bash -c sales
Additional capabilities and security can be provided by using other getty-like programs.
Because OpenLinux includes full source code for the operating system kernel, you can recompile the kernel if the need arises. Reasons to do this include:
Re-compiling the kernel isn't as difficult as it sounds. Depending on your system's speed, re-compiling may take less than 10 minutes or several hours. (A Pentium 200 MHz with 32 MB of RAM takes about 10 minutes for re-compiling.)
You must have the kernel source code packages and supporting development tools installed on your OpenLinux system before using this procedure.
To re-compile the Linux kernel:
CAUTION: Don't name the backup kernel vmlinuz.old; that name is already used internally by the kernel.
make dep ; make clean ; make zlilo ; make modules ; make modules_install
NOTE: You can also enter these commands individually; entering them on a single line completes the compilation process without any additional input from you.
Samba is a Linux software package that provides support for the SMB protocol used by Windows 95/98, Windows NT, and numerous other systems. Samba allows Windows clients to access the file and print capabilities of the Linux system in a manner similar to how those clients would access a Windows NT server.
By using the Samba package included with OpenLinux, you can easily make a replacement for a Windows NT file and print server, allowing Windows clients on your network to access the OpenLinux server as if it were a Windows NT server.
NOTE: The Samba client software on OpenLinux can also be used to access files and printers on Windows 95/98 and Windows NT systems.
This installs the SMB protocol and adds the /etc/samba.d directory to your system. (If you already have a /etc/samba.d directory, the packages are likely already installed, and you can skip this step.)
cat /etc/passwd | mksmbpasswd > /etc/samba.d/smbpasswd
This creates a Samba password file with all of the usernames on your Linux system.
smbadduser Linux-username:Samba-username
NOTE: The two usernames will be the same if you have copied your Linux passwd file to the smbpasswd file as described above.
By default, the following services are set up:
For additional details on setting up Samba, see the smb.conf manual pages.
To start Samba, enter this command (while logged in as root)
NOTE: If you're mapping from a Windows 95/98 system, your Windows username must be the same as the username on the OpenLinux machine whose files you're trying to view.
$ smbclient //windowshost/resourcename
$ smbclient //sundance/C_drive
The smb: \> prompt appears. The smb:\> prompt is an FTP-like interface. You can use commands such as put and get to exchange files with the Windows PC. Use the Help command to see a list of valid commands.
For additional information on setting up Samba for printing, visit the Caldera Systems Web site.
Two valuable resources for creating Samba-based servers are these volumes:
The Network File System enables you to store information on hard disks attached to your OpenLinux system and make these file systems available to other computers that have NFS client software. NFS client software is standard with OpenLinux (simply use the mount -t nfs command) and most other UNIX systems. NFS clients are also available for Windows computers.
NFS is useful for providing automated backups of multiple systems on a LAN, or for network-based installation of software packages. Because of loose security and low speed, however, using NFS over the Internet or within insecure environments isn't recommended.
If you used the standard OpenLinux installation, NFS services were automatically set up. To customize NFS, review the information that follows.
To specify who can mount each file system (or path within a file system) from their NFS client, follow these steps:
Open the /etc/exports file in a text editor.
Add lines that define the path, hostnames, and access level for each file system or path that you want to make accessible to NFS clients on your network.
will allow anyone (originating from any hostname) to have read-only access to the /mnt/cdrom directory.
/opt/wordperfect *.company.com (rw)
Allows any users coming from a hostname within the .company.com domain to access the /opt/wordperfect directory, with read-write access (dangerous, but perhaps necessary to run the application).
The clients can then mount the NFS resource on your OpenLinux system with a command like this one (or equivalent commands or graphical interfaces on their systems):
$ mount -t nfs linuxhostname:/opt/wordperfect/ /applications/wordperfect
NOTE: If you have enabled NFS as a start-up daemon, you can use the following procedure to start NFS immediately (without rebooting).
To re-start NFS services (so that configuration changes take effect), enter these two commands at a command prompt (while logged in as root):
The new configuration is loaded and NFS is running.
CAUTION: NFS mounting involves several security options; the username provided by the client and the access level granted in the /etc/exports file are only two considerations when setting up an NFS server intended for use by numerous clients. See the man pages references below for details on the /etc/exports settings.
All the required NFS daemons are started at boot time by default. The portmapper which controls access to NFS services, however, utilizes the /etc/hosts.allow and /etc/hosts.deny files for access control. To enable other machines to mount a directory from your system via NFS, you must add a line to /etc/hosts.allow for each machine or domain which you wish to allow to connect to the portmapper.
In order to avoid deadlocks, the portmap program does not attempt to look up the remote host name or user name, nor will it try to match NIS netgroups. Thus only network number patterns (IP addresses) will work for portmap access control. For example, to allow all hosts in the madison.com domain (whose network address is 192.168.100.0), you would add the following line to /etc/hosts.allow:
portmap: 192.168.100.0/255.255.255.0
See the hosts_access(5) and rpc.portmap(8) man pages for complete access control details.
To export a filesystem via NFS, so that other systems can mount it, include the directory where the filesystem is mounted on your system in the /etc/exports file. For example, to allow hosts matching *.xmission.com to mount /mnt/source_cd and /mnt/cdrom as read-only filesystems, first add these lines to the /etc/exports file:
/mnt/source_cd *.xmission.com(ro)
Then kill and restart the rpc.nfsd and rpc.mountd daemons so that they will load the new configuration. See the exports(5), rpc.nfsd(8) and rpc.mountd(8) man pages for complete details.
For additional details on NFS services, see the manual pages for exports , nfsd , hosts_access (5), mountd and rpc.portmap , as well as the NFS titles listed in the bibliography.
OpenLinux includes a DOS emulator and a copy of the DR-DOS operating system. This capability is installed and available by default if you used the standard OpenLinux installation.
To use DOS within OpenLinux, enter this command in character mode or in a graphical terminal emulator window:
A DOS session begins, as shown in See DOS sessions can be started from any graphical or character-based command line.. The C:> drive is mapped to the hard disk image of DOS stored within the Linux file system. Change to drive L: to access the root of the Linux filesystem (/).
You can directly run most DOS programs, including graphical DOS games.
Multiple DOS sessions can be started; each is run as a separate Linux process. These can be used to display DOS programs on dumb terminals connected to the Linux system, or for many other uses.
Filenames within the Linux file system are altered to fit a standard 8.3 DOS filename format, which can make it difficult to locate some files, but all DOS file operations are mapped to the Linux filesystem (provided the permissions of the user who started the DOS session are not overstepped).
To exit a DOS session, execute this command at the DOS prompt:
The two files /etc/dosemu.users and /etc/dosemu.conf provide the configuration information for the DOS sessions, and can be changed as needed. The file /etc/dosemu.conf.sample is also provided as a sample, with extensive notes describing how the DOS emulator and DOS itself are configured for use under Linux.
If you are responsible for installing OpenLinux on multiple computers, there are several methods you can use to install more efficiently than from a standard CD-ROM install. Here are some examples:
Using an Install Server, any computer on your LAN can install OpenLinux over the network. This procedure is supported for both binary and source installations of OpenLinux. Because of potential copyright restrictions, this feature is not supported for commercial software installations.
Here are the steps to set up a Lizard install from an NFS Install server (this server should have the nfsd daemon running):
NOTE: Make sure you have enough disk space to hold the entire contents of the CD-ROMs from which you will install. The OpenLinux Install CD-ROM alone consumes 650 MB of hard disk space. If you install the source CD-ROM as well, which you may not want to do, that also uses about 650 MB.
mkdir /install/cd1 /install/cd2
You may only need /install/cd1 if you don't want the source code installed. You can either mount the CD-ROM on that mount point, or copy the contents, as described below: Here is an example of how to copy the contents:
/install *.handsonhistory.com (ro,no_root_squash)
When you set up the DHCP server, there must be an entry for every client to which you want to install. In that entry, you need to identify the client, the install server, and the location of the installation source directory. Here is an example of an entry you would add to the /etc/dhcpd.conf file on the DHCP server:
host maple {
hardware ethernet 00:01:E3:FB:34:35;
fixed-address 192.168.1.3;
option host-name maple.handsonhistory.com;
next-server 192.168.1.1;
filename "/install/cd1";
}
The client is identified as the host named maple. The next three lines identify maple's Ethernet address, IP address, and host name of the client. The next-server option indicates the address of the install server (192.168.1.1). The filename option indicates the location of the installation CD-ROM contents (/install/cd1).
Configuration of the install server is done. The next time you restart your dhcpd daemon, the configuration file is read and the install server will be available.
The client should detect the install server and the source using DHCP. The installation should continue as described in Chapter Three.
While an Install server makes it convenient to access the packages needed to install OpenLinux, a Lizard Unattended Install can add the convenience of presetting configuration options so that installation doesn't require you to sit there and answer questions. It does this by allowing you to set up rules files that are used during installation.
You can use the Lizard Unattended Install from an Install server (described just before this section). Once an Install server is configured, follow this procedure:
For example, if you added source to /install/cd1, you need to create a directory called /install/lizard.
network 192.168.19 start.sh profile XF86Config pkgs.sel finish.sh
In this example, the network entry sets up the default rules used to install on any client in the 192.168.19 network. Other entries identify the preinstall script, the install profile, the X configuration, package selection, and postinstall scripts, in that order. Those files are looked for in the lizard directory.
You can override or supplement the default by using the keyword "hostname" to specify a client that you want to handle differently. You could then create files in the lizard/etc directory that append the IP address to the file name. For example:
You can create a profile by installing OpenLinux on a system, then running the following command on that system:
The result of this command is the file /tmp/lizard.tgz. The file contains the following files in tar/gzip format:
You can untar/unzip this file and use the contents to create profiles for different computers on your network. You want to make sure that the X configuration matches and that the profile and packages are set to create the system that you want.
where path is replaced by auto, or by the NFS path to the lizard directory. For example, you could type any of the following:
install lizard=192.168.19.10:/install/lizard
NOTE: You can control the unattended install remotely from your X display. From the X display, type xhost +. From the install client, insert the boot floppy and type install display=IPADDR:0.0 at the boot prompt (replacing IPADDR with the IP address where the X display is running). Lizard will appear on the X display, where it can remotely control the installation on the install client.
To perform a Lizard Unattended Install from a floppy, do the following:
While we hope the information in this chapter provides system administrators with guidance for many of the topics that they will need to know about, it only scratches the surface of the capabilities of OpenLinux and the configuration information needed to fully utilize those capabilities.
What follows is a list of books intended as further reading for system administrator. Some titles provide general Linux information at a more technical level than this guide does; others are focused on specific tasks such as setting up email or Web servers.
CAUTION: This information is intended to be an aid to OpenLinux system administrators--we hope you will find it useful as you learn more about Linux and its related applications. Nevertheless, Caldera Systems, Inc. neither warrants nor guarantees any of these titles nor the information they contain.