webpointmorpheus total solution web design

webpointmorpheus Linux Info
Linux Administration,
Peripherals, and Hardware

©2005 - material compiled by Bob Carnaghi, www.webpointmorpheus.com

Introduction to Linux System Administration     Top of Page
Linux system administration encompasses several additional tasks which are outlined in this document. The specifics of configuring and administering these items is not addressed, but a functional overview is attempted. Listed below are the items that are considered:
Printing in Linux     Top of Page
Printing in Linux is accomplished on one of two daemons: CUPS - cupsd, or the older Line Printer Daemon - lpd. Of the two, CUPS is the more popular today. The outline schema for printing (which is not generally understood in Linux user land) is that a print job is sent from the user to the print queue or spooler, which holds the job if necessary before sending it to the printer itself. Print queue (located in /var/spool/cups) is software based, and can accept or reject print jobs. Printers are hardware based, and can be enabled or disabled. In the interest of simplicity, a print queue is often named the same as a printer, which tends to cloak the mechanics of printing, and not confuse the subjects of Linux user land.
Another daemon - scheduler - runs to accept jobs into the queue. To check the status of the print queue, type the command lpstat -t. See the man page for additional flags for the lpstat command. On current Linux systems that are running CUPS, there are pseudo-commands that are the same in the LPD version of printing. See the table below for more print commands.
Common Linux Print Commands
Command Description
 accept print queue name  Accepts jobs into a specified print queue.
 reject print queue name  Rejects jobs from a specified print queue.
 enable printer name  Enables a specific printer.*
 disable printer name  Disables a specific printer.
 lp printer name  Sends a job to the specified printer.
 lpr  Similar to lp, used to print jobs.
 lprm print job  Remove specified job from print queue.
 cancel  Used in CUPS to delete a specified print job
 lpstat  Shows a list of jobs in the print queue. Optionally specify the printer name.
 lpq  Similar to lpstat, view the print queue.
 lpadmin  Administrate a printer.
 lpc  View the status of printers.
Notes:
This command must be entered as /usr/bin/enable (path may vary across systems) to distinguish it from the BASH built-in command enable.
Printers can be configured in the GUI environment by going through the provided dialog boxes. The command system-config-printer-tui will activate the dialog box for configuring printers. Printers are listed in the file /etc/printcap. See also the files /etc/cups/cupsd.conf and /etc/cups/printers.conf.
Linux Log Files     Top of Page
Log files in Linux tell the story, the whole story, and nothing but the real story. Consistent review of the Linux log files is essential for proper system operation, as well as security considerations. Consider a situation where a brute-force hacking attempt is made on a server in a periodic fashion. The hacker makes an attempt, and does not succeed. He rewrites his algorithm, then comes back in a day or so, or less, and tries again. This time he is smarter and stronger. If the system admin has checked his log files, he will see the 500 or so failed attempts to login to the system. If the system admin does not check the log files, or read his mail, he is dumber and weaker than the person who is attempting to hack into the system. Log files are not considered in this document. See the Linux Logfile and Backup document for more information.
Users & Groups in Linux     Top of Page
The concepts of users and groups are the organizational units by which access to and use of a computer system are regulated. The Linux operating system has an effective way of determining file, directory, and process ownership, and the means to authenticate users who attempt to use these resources. Every user and group on the system has a user account, a primary group (which is created when the user is added to the system), a User Identifier (UID), and a Group Identifier (GID) at a minimum. There is other user information that can be stored on the system, some of which is in the form of GECOS (General Electric Comprehensive Operating System) information. Type finger username to retrieve information about a user. UIDs less than 100 refer to system daemons that log in to the system. The root user always has a UID of #0. Typically UIDs begin with #500 for the general run of system users. User accounts are protected, identified, and authenticated with passwords. It is possible to have a minimum length password policy in effect, as well as password rotation. This ensures that passwords are as secure as possible. Certain user information is stored in the /etc/passwd file. Group information is stored in the /etc/group file. If passwords are encrypted, they are hashed with the MD5 algorighm and stored in the /etc/shadow file, which is readable by the root user only. Enabling password encryption is done when the Linux operating system is installed, or by issuing the pwconv command. To switch from using password encryption, use the pwunconv command.
Creating User Accounts     Top of Page
To create users on the Linux system use the useradd username command. A user with username will be created. The user will be given a UID, shell, home dirctory, etc. from default values that are contained in the /etc/login.defs directory and the /etc/default/useradd directory. Additionally, the /etc/skel directory contains files that are copied to all new users' home directories when the home directory is created. After a user has been created, and before a password has been assigned to their account, the /etc/shadow file will contain one or more  !  exclamation points in the password location of the appropriate line. Make sure to set the password for these users. In order to change the password for a user, enter the passwd username command. The root user can change the password for any user. Users changing their own passwords will only be allowed to change their own password. Type man passwd to see the full list of options for the command.
Modifying User Accounts     Top of Page
There are many reasons to alter user account information, even lock a user account. Use the usermod command to modify most information about a user account. The chage command will change user password information. The chsh command will change the login shell of a user. See the man page for any of these commands for more information.
Deleting User Accounts     Top of Page
A user account can be deleted with the userdel command. The userdel -r removes the user and the home directory of the user as well as the home directory's contents. When a user is deleted, the files that the user owned become owned by the UID of that user. The future user who gets that UID becomes the owner of those files.
Managing Groups     Top of Page
Groups can be added to the system by manually editing the /etc/group file, or by using the groupadd command. To modify group info, such as GID, use the groupmod command. To delete a group, use the groupdel command. A GUI utility can be invoked with the system-config-users command. In order to see group membership, issue the groups command. The password field for groups is usually empty, but can be set when changing the primary group membership with the newgrp command. The password is set with the gpasswd command, and is stored in the /etc/gpasswd directory. Type man gpasswd for more info.
Hardware & Other Peripherals in Linux     Top of Page
Installing and maintaining hardware on a Linux system is an ongoing challenge. It seems that drivers for hardware that are compatible with Linux is often optional to manufacturers. The first place to start is by looking on a compatibility list. Below are three resources for hardware compatibility lists:
  1. Linux Hardware HOWTO
  2. Linux Hardware INcompatibility List
  3. Linux Questions Hardware List
The equivalent of device drivers (a Windows term) in Linux are kernel modules. At this point, the concept of dynamically loading modules has made life much easier for the Linux administrator. These modules are loaded when needed by the kernel, and are unloaded when the device is no longer used. See the kernel section for more details on loading these modules. The Linux system typically runs the kudzu daemon at system boot to check for the presence of new hardware. If the hardware is detected, the option to configure the hardware at that time is offered.
Here's a nice article on checking a CPU & RAM in a Linux system.
Other Documents in this Series      Top of Page
  1. Introduction and History
  2. Installation, Advanced Installation, and Usage
  3. The Linux Kernel and the Boot Process
  4. Filesystems - Management & Administration
  5. The BASH and Other Shells
  6. System Initialization and the X Environment
  7. Linux Processes
  8. Linux Administration, Peripherals, and Hardware
  9. Software Installation and Management
  10. Backups and Log Files
  11. Performance and Problems
  12. Network Configuration
  13. Security
  14. Key Linux Commands
  15. Essential Linux Definitions
webpointmorpheus Home       Technical Pages Site Map      This page was last modified: Wednesday January 03, 2007 10:53 AM