Sunteți pe pagina 1din 4

Administrative commands

Many commands are intended only for root. When you log in as root, your $PATH
variable is set to include some directories that contain commands for the root user.
These include the following directories:
/sbin This contains commands for modifying your disk partitions (such as fdisk),
changing boot procedures (grub), and changing system states (init).
/usr/sbin This contains commands for managing user accounts (such as
useradd) and configuring your mouse (mouseconfig) or system services (chkconfig).
Commands that run as daemon processes are also contained in this directory. (Look
for commands that end in "d" such as sshd, pppd, and crond.)
Some administrative commands are contained in regular user directories (such as /bin
and /usr/bin). This is especially true of commands that have some options available to
everyone. An example is the /bin/mount command, which anyone can use to list
mounted file systems, but only root can use to mount file systems.
To find commands that are intended primarily for the system administrator, check out
the section 8 manual pages (usually in /usr/share/man/man8). They contain descriptions
and options for most Red Hat Linux administrative commands.
Some third-party applications will add administrative commands to directories that are
not in your PATH. For example, an application may put commands in /usr/local/bin,
/opt/bin, or /usr/local/sbin. In those cases, you may want to add those directories to
your PATH.
Administrative configuration files
Configuration files are another mainstay of Linux administration. Almost everything you
set up for your particular computer user accounts, network addresses, or GUI
preferences is stored in plain-text files. This has some advantages and some
disadvantages.
The advantage of plain-text files is that it is easy to read and change them. Any text
editor will do. On the downside, however, is that as you edit configuration files, no error
checking is going on. You have to run the program that reads these files (such as a
network daemon or the X desktop) to find out if you set up the files correctly. A comma
or a quote in the wrong place can sometimes cause a whole interface to fail.
Throughout this book, I describe the configuration files you need to set up the different
features that make up Red Hat Linux. In terms of a general perspective on configuration
files, however, there are several locations in the Red Hat Linux file system where
configuration files are stored. Here are some of the major locations:
$HOME All users store information in their home directories that directs how their
login accounts behave. Most configuration files in $HOME begin with a dot (.), so
they don't appear as a user's directory when you use a standard ls command (you
need to type ls -a to see them). There are dot files that define how each user's shell
behaves, the desktop look and feel , and options used with your text editor. There
are even files (such as .ssh/* and .rhosts) that configure network permissions for
each user.
/etc This directory contains most of the basic Linux system-configuration files.
The following /etc configuration files are of interest:
o adjtime Holds to data to adjust the hardware clock (see the hwclock man
page).
o aliases Can contain distribution lists used by the Linux mail service.
o bashrc Sets system-wide defaults for bash shell users. (By default, it sets the
shell prompt to include current user name, host name, current directory, and
other values.)
o cdrecord.conf Contains defaults used for recording CDs.
o crontab Sets cron environment and times for running automated tasks.
o csh.cshrc (or cshrc) Sets system-wide defaults for csh (C shell) users.
o exports Contains a list of local directories that are available to be shared by
remote computers using the Network File System (NFS).
o fdprm Sets parameters for common floppy disk formats.
o fstab Identifies the devices for common storage media (hard disk, floppy, CD-
ROM, etc.) and locations where they are mounted in the Linux system. This is
used by the mount command to choose which file systems to mount.
o group Identifies group names and group IDs (GIDs) that are defined on the
systems. Group permissions in Red Hat Linux are defined by the second of three
sets of rwx (read, write, execute) bits associated with each file and directory.
o gshadow Contains shadow passwords for groups.
o host.conf Sets the locations in which domain names (e.g., redhat.com) are
searched for on TCP/IP networks (such as the Internet). By default, the local
hosts file is searched, then any nameserver entries in resolv.conf.
o hosts Contains IP addresses and host names that you can reach from your
computer. (Usually this file is used just to store names of computers on your LAN
or small private network.)
o hosts.allow Lists host computers that are allowed to use certain TCP/IP
services from the local computer.
o hosts.deny Lists host computers that are not allowed to use certain TCP/IP
services from the local computer (doesn't exist by default).
o inittab Contains information that defines which programs start and stop when
Red Hat Linux boots, shuts down, or goes into different states in between. This is
the most basic configuration file for starting Linux.
o issue Contains the lines that are displayed when a terminal is ready to let you
log in to Red Hat Linux from a local terminal, or the console in text mode.
o issue.net Contains login lines that are displayed to users that try to log in to
the Linux system from a computer on the network using the telnet service.
o lilo.conf Sets Linux boot loader (lilo) parameters to boot the computer. In
particular, it lists information about bootable partitions on your computer. (If you
are using grub, which replaced lilo as the default boot manager, the
lilo.conf.anaconda file is available. You can copy that file to lilo.conf to switch to
LILO.)
o mail.rc Sets system-wide parameters associated with using mail.
o man.config Used by the man command to determine the default path to the
location of man pages.
o modules.conf Contains aliases and options related to loadable kernel modules
used by your computer.
o mtab Contains a list of file systems that are currently mounted.
o mtools.conf Contains settings used by DOS tools in Linux.
o named.conf Contains DNS settings if you are running your own DNS server.
o ntp.conf Includes information needed to run the Network Time Protocol (NTP).
o passwd Stores account information for all valid users for the system. Also
includes other information, such as the home directory and default shell.
o printcap Contains definitions for the printers configured for your computer.
o profile Sets system-wide environment and start-up programs for all users.
This file is read when the user logs in.

S-ar putea să vă placă și