엮음 8
1801 Varsity Drive
Raleigh, NC 27606-2072 USA
Phone: +1 919 754 3700
Phone: 888 733 4281
Fax: +1 919 754 3701
mount
Commandproc
File Systemproc
File System/proc/apm
/proc/buddyinfo
/proc/cmdline
/proc/cpuinfo
/proc/crypto
/proc/devices
/proc/dma
/proc/execdomains
/proc/fb
/proc/filesystems
/proc/interrupts
/proc/iomem
/proc/ioports
/proc/kcore
/proc/kmsg
/proc/loadavg
/proc/locks
/proc/mdstat
/proc/meminfo
/proc/misc
/proc/modules
/proc/mounts
/proc/mtrr
/proc/partitions
/proc/pci
/proc/slabinfo
/proc/stat
/proc/swaps
/proc/sysrq-trigger
/proc/uptime
/proc/version
/proc/
sysctl
Commandsmb.conf
Filehttpd
httpd.conf
/etc/openldap/schema/
Directorysysconfig
Directory/etc/sysconfig/
Directory/etc/sysconfig/amd
/etc/sysconfig/apmd
/etc/sysconfig/arpwatch
/etc/sysconfig/authconfig
/etc/sysconfig/autofs
/etc/sysconfig/clock
/etc/sysconfig/desktop
/etc/sysconfig/dhcpd
/etc/sysconfig/exim
/etc/sysconfig/firstboot
/etc/sysconfig/gpm
/etc/sysconfig/hwconf
/etc/sysconfig/i18n
/etc/sysconfig/init
/etc/sysconfig/ip6tables-config
/etc/sysconfig/iptables-config
/etc/sysconfig/irda
/etc/sysconfig/keyboard
/etc/sysconfig/kudzu
/etc/sysconfig/named
/etc/sysconfig/network
/etc/sysconfig/nfs
/etc/sysconfig/ntpd
/etc/sysconfig/radvd
/etc/sysconfig/samba
/etc/sysconfig/selinux
/etc/sysconfig/sendmail
/etc/sysconfig/spamassassin
/etc/sysconfig/squid
/etc/sysconfig/system-config-securitylevel
/etc/sysconfig/system-config-selinux
/etc/sysconfig/system-config-users
/etc/sysconfig/system-logviewer
/etc/sysconfig/tux
/etc/sysconfig/vncservers
/etc/sysconfig/xinetd
/etc/sysconfig/
Directorycommand
cat testfile
command to view the contents of a file, named testfile
, in the current working directory.
file name
.bashrc
file in your home directory contains bash shell definitions and aliases for your own use.
/etc/fstab
file contains information about different system devices and file systems.
webalizer
RPM if you want to use a Web server log file analysis program.
ls
, then a character, and finally the Tab key. Your terminal displays the list of files in the working directory that begin with that character.
computer output
ls
command displays the contents of a directory. For example:
Desktop about.html logs paulwesterberg.png Mail backupfiles mail reports
prompt
$
#
[stephen@maturin stephen]$
leopard login:
user input
text
is displayed in this style:
text
command at the boot:
prompt.
<replaceable>
<version-number>
is displayed in this style:
/usr/src/kernels/<version-number>
/
, where <version-number>
is the version and type of kernel installed on this system.
/usr/share/doc/
contains additional documentation for packages installed on your system.
http://bugzilla.redhat.com/bugzilla/
) against the component Deployment_Guide
.
parted
utility to manage partitions and access control lists (ACLs) to customize file permissions.
차례
mount
Commandproc
File Systemproc
File System/proc/apm
/proc/buddyinfo
/proc/cmdline
/proc/cpuinfo
/proc/crypto
/proc/devices
/proc/dma
/proc/execdomains
/proc/fb
/proc/filesystems
/proc/interrupts
/proc/iomem
/proc/ioports
/proc/kcore
/proc/kmsg
/proc/loadavg
/proc/locks
/proc/mdstat
/proc/meminfo
/proc/misc
/proc/modules
/proc/mounts
/proc/mtrr
/proc/partitions
/proc/pci
/proc/slabinfo
/proc/stat
/proc/swaps
/proc/sysrq-trigger
/proc/uptime
/proc/version
/proc/
sysctl
Command/usr/
partition as read-only. This second point is important because the directory contains common executables and should not be changed by users. Also, since the /usr/
directory is mounted as read-only, it can be mounted from the CD-ROM or from another machine via a read-only NFS mount.
/boot/
Directory/boot/
directory contains static files required to boot the system, such as the Linux kernel. These files are essential for the system to boot properly.
/boot/
directory. Doing so renders the system unbootable.
/dev/
Directory/dev/
directory contains device nodes that either represent devices that are attached to the system or virtual devices that are provided by the kernel. These device nodes are essential for the system to function properly. The udev
daemon takes care of creating and removing all these device nodes in /dev/
.
/dev
directory and subdirectories are either character (providing only a serial stream of input/output) or block (accessible randomly). Character devices include mouse, keyboard, modem while block devices include hard disk, floppy drive etc. If you have GNOME or KDE installed in your system, devices such as external drives or cds are automatically detected when connected (e.g via usb) or inserted (e.g via CD or DVD drive) and a popup window displaying the contents is automatically displayed. Files in the /dev
directory are essential for the system to function properly.
/dev
File | Description |
---|---|
/dev/hda | The master device on primary IDE channel. |
/dev/hdb | The slave device on primary IDE channel. |
/dev/tty0 | The first virtual console. |
/dev/tty1 | The second virtual console. |
/dev/sda | The first device on primary SCSI or SATA channel. |
/dev/lp0 | The first parallel port. |
/etc/
Directory/etc/
directory is reserved for configuration files that are local to the machine. No binaries are to be placed in /etc/
. Any binaries that were once located in /etc/
should be placed into /sbin/
or /bin/
.
/etc
are the X11/
and skel/
:
/etc |- X11/ |- skel/
/etc/X11/
directory is for X Window System configuration files, such as xorg.conf
. The /etc/skel/
directory is for "skeleton" user files, which are used to populate a home directory when a user is first created. Applications also store their configuration files in this directory and may reference them when they are executed.
/lib/
Directory/lib/
directory should contain only those libraries needed to execute the binaries in /bin/
and /sbin/
. These shared library images are particularly important for booting the system and executing commands within the root file system.
/media/
Directory/media/
directory contains subdirectories used as mount points for removable media such as usb storage media, DVDs, CD-ROMs, and Zip disks.
/mnt/
Directory/mnt/
directory is reserved for temporarily mounted file systems, such as NFS file system mounts. For all removable media, please use the /media/
directory. Automatically detected removable media will be mounted in the /media
directory.
/mnt
directory must not be used by installation programs.
/opt/
Directory/opt/
directory provides storage for most application software packages.
/opt/
directory creates a directory bearing the same name as the package. This directory, in turn, holds files that otherwise would be scattered throughout the file system, giving the system administrator an easy way to determine the role of each file within a particular package.
sample
is the name of a particular software package located within the /opt/
directory, then all of its files are placed in directories inside the /opt/sample/
directory, such as /opt/sample/bin/
for binaries and /opt/sample/man/
for manual pages.
/opt/
directory, giving that large package a way to organize itself. In this way, our sample
package may have different tools that each go in their own sub-directories, such as /opt/sample/tool1/
and /opt/sample/tool2/
, each of which can have their own bin/
, man/
, and other similar directories.
/proc/
Directory/proc/
directory contains special files that either extract information from or send information to the kernel. Examples include system memory, cpu information, hardware configuration etc.
/proc/
and the many ways this directory can be used to communicate with the kernel, an entire chapter has been devoted to the subject. For more information, refer to 4장. The proc
File System.
/sbin/
Directory/sbin/
directory stores executables used by the root user. The executables in /sbin/
are used at boot time, for system administration and to perform system recovery operations. Of this directory, the FHS says:
/sbin
contains binaries essential for booting, restoring, recovering, and/or repairing the system in addition to the binaries in/bin
. Programs executed after/usr/
is known to be mounted (when there are no problems) are generally placed into/usr/sbin
. Locally-installed system administration programs should be placed into/usr/local/sbin
.
/sbin/
:
arp
,clock
,halt
,init
,fsck.*
,grub
,ifconfig
,mingetty
,mkfs.*
,mkswap
,reboot
,route
,shutdown
,swapoff
,swapon
/srv/
Directory/srv/
directory contains site-specific data served by your system running Red Hat Enterprise Linux. This directory gives users the location of data files for a particular service, such as FTP, WWW, or CVS. Data that only pertains to a specific user should go in the /home/
directory.
/sys/
Directory/sys/
directory utilizes the new sysfs
virtual file system specific to the 2.6 kernel. With the increased support for hot plug hardware devices in the 2.6 kernel, the /sys/
directory contains information similarly held in /proc/
, but displays a hierarchical view of specific device information in regards to hot plug devices.
/usr/
Directory/usr/
directory is for files that can be shared across multiple machines. The /usr/
directory is often on its own partition and is mounted read-only. At a minimum, the following directories should be subdirectories of /usr/
:
/usr |- bin/ |- etc/ |- games/ |- include/ |- kerberos/ |- lib/ |- libexec/ |- local/ |- sbin/ |- share/ |- src/ |- tmp -> ../var/tmp/
/usr/
directory, the bin/
subdirectory contains executables, etc/
contains system-wide configuration files, games
is for games, include/
contains C header files, kerberos/
contains binaries and other Kerberos-related files, and lib/
contains object files and libraries that are not designed to be directly utilized by users or shell scripts. The libexec/
directory contains small helper programs called by other programs, sbin/
is for system administration binaries (those that do not belong in the /sbin/
directory), share/
contains files that are not architecture-specific, src/
is for source code.
/usr/local/
DirectoryThe/usr/local
hierarchy is for use by the system administrator when installing software locally. It needs to be safe from being overwritten when the system software is updated. It may be used for programs and data that are shareable among a group of hosts, but not found in/usr
.
/usr/local/
directory is similar in structure to the /usr/
directory. It has the following subdirectories, which are similar in purpose to those in the /usr/
directory:
/usr/local |- bin/ |- etc/ |- games/ |- include/ |- lib/ |- libexec/ |- sbin/ |- share/ |- src/
/usr/local/
directory is slightly different from that specified by the FHS. The FHS says that /usr/local/
should be where software that is to remain safe from system software upgrades is stored. Since software upgrades can be performed safely with RPM Package Manager (RPM), it is not necessary to protect files by putting them in /usr/local/
. Instead, the /usr/local/
directory is used for software that is local to the machine.
/usr/
directory is mounted as a read-only NFS share from a remote host, it is still possible to install a package or program under the /usr/local/
directory.
/var/
Directory/usr/
as read-only, any programs that write log files or need spool/
or lock/
directories should write them to the /var/
directory. The FHS states /var/
is for:
...variable data files. This includes spool directories and files, administrative and logging data, and transient and temporary files.
/var/
directory:
/var |- account/ |- arpwatch/ |- cache/ |- crash/ |- db/ |- empty/ |- ftp/ |- gdm/ |- kerberos/ |- lib/ |- local/ |- lock/ |- log/ |- mail -> spool/mail/ |- mailman/ |- named/ |- nis/ |- opt/ |- preserve/ |- run/ +- spool/ |- at/ |- clientmqueue/ |- cron/ |- cups/ |- exim/ |- lpd/ |- mail/ |- mailman/ |- mqueue/ |- news/ |- postfix/ |- repackage/ |- rwho/ |- samba/ |- squid/ |- squirrelmail/ |- up2date/ |- uucp |- uucppublic/ |- vbox/ |- tmp/ |- tux/ |- www/ |- yp/
messages
and lastlog
, go in the /var/log/
directory. The /var/lib/rpm/
directory contains RPM system databases. Lock files go in the /var/lock/
directory, usually in directories for the program using the file. The /var/spool/
directory has subdirectories for programs in which data files are stored.
/var/lib/rpm/
directory. For more information on RPM, refer to the chapter 11장. RPM을 사용한 패키지 관리.
/var/cache/yum/
directory contains files used by the Package Updater, including RPM header information for the system. This location may also be used to temporarily store RPMs downloaded while updating the system. For more information about Red Hat Network, refer to 14장. Product Subscriptions and Entitlements.
/etc/sysconfig/
directory. This directory stores a variety of configuration information. Many scripts that run at boot time use the files in this directory. Refer to 30장. The sysconfig
Directory for more information about what is within this directory and the role these files play in the boot process.
mount
Commandmount
or umount
command respectively. This chapter describes the basic usage of these commands, and covers some advanced topics such as moving a mount point or creating shared subtrees.
mount
command with no additional arguments:
mount
device
ondirectory
typetype
(options
)
sysfs
, tmpfs
, and others. To display only the devices with a certain file system type, supply the -t
option on the command line:
mount
-t
type
mount
command to list the mounted file systems, see 예 2.1. “Listing Currently Mounted ext3
File Systems”.
ext3
File Systems/
and /boot
partitions are formatted to use ext3
. To display only the mount points that use this file system, type the following at a shell prompt:
~]$ mount -t ext3
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
/dev/vda1 on /boot type ext3 (rw)
mount
command in the following form:
mount
[option
…]device
directory
mount
command is run, it reads the content of the /etc/fstab
configuration file to see if the given file system is listed. This file contains a list of device names and the directory in which the selected file systems should be mounted, as well as the file system type and mount options. Because of this, when you are mounting a file system that is specified in this file, you can use one of the following variants of the command:
mount
[option
…]directory
mount
[option
…]device
root
, you must have permissions to mount the file system (see 2.2.2절. “Specifying the Mount Options”).
mount
detects the file system automatically. However, there are certain file systems, such as NFS
(Network File System) or CIFS
(Common Internet File System), that are not recognized, and need to be specified manually. To specify the file system type, use the mount
command in the following form:
mount
-t
type
device
directory
mount
command. For a complete list of all available file system types, consult the relevant manual page as referred to in 2.4.1절. “Installed Documentation”.
Type | Description |
---|---|
ext2
|
The ext2 file system.
|
ext3
|
The ext3 file system.
|
iso9660
|
The ISO 9660 file system. It is commonly used by optical media, typically CDs.
|
jfs
|
The JFS file system created by IBM.
|
nfs
|
The NFS file system. It is commonly used to access files over the network.
|
nfs4
|
The NFSv4 file system. It is commonly used to access files over the network.
|
ntfs
|
The NTFS file system. It is commonly used on machines that are running the Windows operating system.
|
udf
|
The UDF file system. It is commonly used by optical media, typically DVDs.
|
vfat
|
The FAT file system. It is commonly used on machines that are running the Windows operating system, and on certain digital media such as USB flash drives or floppy disks.
|
/dev/sdc1
device and that the /media/flashdisk/
directory exists, you can mount it to this directory by typing the following at a shell prompt as root
:
~]# mount -t vfat /dev/sdc1 /media/flashdisk
mount
-o
options
mount
will incorrectly interpret the values following spaces as additional parameters.
Option | Description |
---|---|
async
| Allows the asynchronous input/output operations on the file system. |
auto
|
Allows the file system to be mounted automatically using the mount -a command.
|
defaults
|
Provides an alias for async,auto,dev,exec,nouser,rw,suid .
|
exec
| Allows the execution of binary files on the particular file system. |
loop
| Mounts an image as a loop device. |
noauto
|
Disallows the automatic mount of the file system using the mount -a command.
|
noexec
| Disallows the execution of binary files on the particular file system. |
nouser
|
Disallows an ordinary user (that is, other than root ) to mount and unmount the file system.
|
remount
| Remounts the file system in case it is already mounted. |
ro
| Mounts the file system for reading only. |
rw
| Mounts the file system for both reading and writing. |
user
|
Allows an ordinary user (that is, other than root ) to mount and unmount the file system.
|
/media/cdrom/
directory exists, you can mount the image to this directory by running the following command as root
:
~]# mount -o ro,loop Fedora-14-x86_64-Live-Desktop.iso /media/cdrom
mount
command implements the --bind
option that provides a means for duplicating certain mounts. Its usage is as follows:
mount
--bind
old_directory
new_directory
mount
--rbind
old_directory
new_directory
mount
--make-shared
mount_point
mount
--make-rshared
mount_point
mount
--make-slave
mount_point
mount
--make-rslave
mount_point
/media
directory to appear in /mnt
as well, but you do not want any mounts in the /mnt
directory to be reflected in /media
. To do so, as root
, first mark the /media
directory as “shared”:
~]#mount --bind /media /media
~]#mount --make-shared /media
/mnt
, but mark it as “slave”:
~]#mount --bind /media /mnt
~]#mount --make-slave /mnt
/media
also appears in /mnt
. For example, if you have non-empty media in your CD-ROM drive and the /media/cdrom/
directory exists, run the following commands:
~]#mount /dev/cdrom /media/cdrom
~]#ls /media/cdrom
EFI GPL isolinux LiveOS ~]#ls /mnt/cdrom
EFI GPL isolinux LiveOS
/mnt
directory are not reflected in /media
. For instance, if you have a non-empty USB flash drive that uses the /dev/sdc1
device plugged in and the /mnt/flashdisk/
directory is present, type: :
~]#mount /dev/sdc1 /mnt/flashdisk
~]#ls /media/flashdisk
~]#ls /mnt/flashdisk
en-US publican.cfg
mount
--make-private
mount_point
mount
--make-rprivate
mount_point
root
:
~]#mount --bind /media /media
~]#mount --make-shared /media
~]#mount --bind /media /mnt
/mnt
directory as “private”, type:
~]# mount --make-private /mnt
/media
appears in /mnt
. For example, if you have non-empty media in your CD-ROM drive and the /media/cdrom/
directory exists, run the following commands:
~]#mount /dev/cdrom /media/cdrom
~]#ls /media/cdrom
EFI GPL isolinux LiveOS ~]#ls /mnt/cdrom
~]#
/mnt
directory are not reflected in /media
. For instance, if you have a non-empty USB flash drive that uses the /dev/sdc1
device plugged in and the /mnt/flashdisk/
directory is present, type:
~]#mount /dev/sdc1 /mnt/flashdisk
~]#ls /media/flashdisk
~]#ls /mnt/flashdisk
en-US publican.cfg
mount
--make-unbindable
mount_point
mount
--make-runbindable
mount_point
/media
directory from being shared, as root
, type the following at a shell prompt:
~]#mount --bind /media /media
~]#mount --make-unbindable /media
~]# mount --bind /media /mnt
mount: wrong fs type, bad option, bad superblock on /media/,
missing code page or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
mount
--move
old_directory
new_directory
/mnt/userdirs/
, as root
, you can move this mount point to /home
by using the following command:
~]# mount --move /mnt/userdirs /home
~]#ls /mnt/userdirs
~]#ls /home
jill joe
umount
command:
umount
directory
umount
device
root
, you must have permissions to unmount the file system (see 2.2.2절. “Specifying the Mount Options”). See 예 2.9. “Unmounting a CD” for an example usage.
umount
command will fail with an error. To determine which processes are accessing the file system, use the fuser
command in the following form:
fuser
-m
directory
/media/cdrom/
directory, type:
~]$ fuser -m /media/cdrom
/media/cdrom: 1793 2013 2022 2435 10532c 10672c
/media/cdrom/
directory, type the following at a shell prompt:
~]$ umount /media/cdrom
man 8 mount
— The manual page for the mount
command that provides a full documentation on its usage.
man 8 umount
— The manual page for the umount
command that provides a full documentation on its usage.
man 5 fstab
— The manual page providing a thorough description of the /etc/fstab
file format.
e2fsck
program. This is a time-consuming process that can delay system boot time significantly, especially with large volumes containing a large number of files. During this time, any data on the volumes is unreachable.
mkfs
.
e2label
.
tune2fs
allows you to convert an ext2
filesystem to ext3
.
e2fsck
utility to check your filesystem before and after using tune2fs
. A default installation of Red Hat Enterprise Linux uses ext3 for all file systems.
ext2
filesystem to ext3
, log in as root and type the following command in a terminal:
tune2fs -j <block_device>
<block_device>
contains the ext2 filesystem you wish to convert.
/dev/mapper/VolGroup00-LogVol02
.
/dev/hdb
X
, where hdb
is a storage device name and X
is the partition number.
df
command to display mounted file systems.
/dev/mapper/VolGroup00-LogVol02
mkinitrd
program. For information on using the mkinitrd
command, type man mkinitrd
. Also, make sure your GRUB configuration loads the initrd
.
umount /dev/mapper/VolGroup00-LogVol02
tune2fs -O ^has_journal /dev/mapper/VolGroup00-LogVol02
e2fsck -y /dev/mapper/VolGroup00-LogVol02
mount -t ext2 /dev/mapper/VolGroup00-LogVol02
/mount/point
/mount/point
부분에 파티션의 마운트 지점을 입력해 주십시오
.journal
file at the root level of the partition by changing to the directory where it is mounted and typing:
rm -f .journal
/etc/fstab
file.
proc
File Systemproc
File System/proc/apm
/proc/buddyinfo
/proc/cmdline
/proc/cpuinfo
/proc/crypto
/proc/devices
/proc/dma
/proc/execdomains
/proc/fb
/proc/filesystems
/proc/interrupts
/proc/iomem
/proc/ioports
/proc/kcore
/proc/kmsg
/proc/loadavg
/proc/locks
/proc/mdstat
/proc/meminfo
/proc/misc
/proc/modules
/proc/mounts
/proc/mtrr
/proc/partitions
/proc/pci
/proc/slabinfo
/proc/stat
/proc/swaps
/proc/sysrq-trigger
/proc/uptime
/proc/version
/proc/
sysctl
Command/proc/
directory — also called the proc
file system — contains a hierarchy of special files which represent the current state of the kernel — allowing applications and users to peer into the kernel's view of the system.
/proc/
directory, one can find a wealth of information detailing the system hardware and any processes currently running. In addition, some of the files within the /proc/
directory tree can be manipulated by users and applications to communicate configuration changes to the kernel.
/proc/
directory contains another type of file called a virtual file. It is for this reason that /proc/
is often referred to as a virtual file system.
/proc/interrupts
, /proc/meminfo
, /proc/mounts
, and /proc/partitions
provide an up-to-the-moment glimpse of the system's hardware. Others, like the /proc/filesystems
file and the /proc/sys/
directory provide system configuration information and interfaces.
/proc/ide/
contains information for all physical IDE devices. Likewise, process directories contain information about each running process on the system.
cat
, more
, or less
commands on files within the /proc/
directory, users can immediately access enormous amounts of information about the system. For example, to display the type of CPU a computer has, type cat /proc/cpuinfo
to receive output similar to the following:
processor : 0 vendor_id : AuthenticAMD cpu family : 5 model : 9 model name : AMD-K6(tm) 3D+ Processor stepping : 1 cpu MHz : 400.919 cache size : 256 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr mce cx8 pge mmx syscall 3dnow k6_mtrr bogomips : 799.53
/proc/
file system, some of the information is easily understandable while some is not human-readable. This is in part why utilities exist to pull data from virtual files and display it in a useful way. Examples of these utilities include lspci
, apm
, free
, and top
.
/proc/
directory are readable only by the root user.
/proc/
directory are read-only. However, some can be used to adjust settings in the kernel. This is especially true for files in the /proc/sys/
subdirectory.
echo
command and a greater than symbol (>
) to redirect the new value to the file. For example, to change the hostname on the fly, type:
echo www.example.com
> /proc/sys/kernel/hostname
cat /proc/sys/net/ipv4/ip_forward
returns either a 0
or a 1
. A 0
indicates that the kernel is not forwarding network packets. Using the echo
command to change the value of the ip_forward
file to 1
immediately turns packet forwarding on.
/proc/sys/
subdirectory is /sbin/sysctl
. For more information on this command, refer to 4.4절. “Using the sysctl
Command”
/proc/sys/
subdirectory, refer to 4.3.9절. “ /proc/sys/
”.
proc
File System/proc/
directory.
/proc/apm
apm
command. If a system with no battery is connected to an AC power source, this virtual file would look similar to the following:
1.16 1.2 0x07 0x01 0xff 0x80 -1% -1 ?
apm -v
command on such a system results in output similar to the following:
APM BIOS 1.2 (kernel driver 1.16ac) AC on-line, no system battery
apm
is able do little more than put the machine in standby mode. The apm
command is much more useful on laptops. For example, the following output is from the command cat /proc/apm
on a laptop while plugged into a power outlet:
1.16 1.2 0x03 0x01 0x03 0x09 100% -1 ?
apm
file changes to something like the following:
1.16 1.2 0x03 0x00 0x00 0x01 99% 1792 min
apm -v
command now yields more useful data, such as the following:
APM BIOS 1.2 (kernel driver 1.16) AC off-line, battery status high: 99% (1 day, 5:52)
/proc/buddyinfo
DMA
row references the first 16 MB on a system, the HighMem
row references all memory greater than 4 GB on a system, and the Normal
row references all memory in between.
/proc/buddyinfo
:
Node 0, zone DMA 90 6 2 1 1 ... Node 0, zone Normal 1650 310 5 0 0 ... Node 0, zone HighMem 2 0 0 1 1 ...
/proc/cmdline
/proc/cmdline
file looks like the following:
ro root=/dev/VolGroup00/LogVol00 rhgb quiet 3
ro
on the kernel boot line overrides any instances of rw
.
/proc/cmdline
output, the root filesystem image is located on the first logical volume (LogVol00
) of the first LVM volume group (VolGroup00
). On a system not using Logical Volume Management, the root file system might be located on /dev/sda1
or /dev/sda2
, meaning on either the first or second partition of the first SCSI or SATA disk drive, depending on whether we have a separate (preceding) boot or swap partition on that drive.
/etc/inittab
shows that the default runlevel is set to 5 with a line like this:
id:5:initdefault:
/proc/cpuinfo
/proc/cpuinfo
:
processor : 0 vendor_id : GenuineIntel cpu family : 15 model : 2 model name : Intel(R) Xeon(TM) CPU 2.40GHz stepping : 7 cpu MHz : 2392.371 cache size : 512 KB physical id : 0 siblings : 2 runqueue : 0 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm bogomips : 4771.02
processor
— Provides each processor with an identifying number. On systems that have one processor, only a 0
is present.
cpu family
— Authoritatively identifies the type of processor in the system. For an Intel-based system, place the number in front of "86" to determine the value. This is particularly helpful for those attempting to identify the architecture of an older system such as a 586, 486, or 386. Because some RPM packages are compiled for each of these particular architectures, this value also helps users determine which packages to install.
model name
— Displays the common name of the processor, including its project name.
cpu MHz
— Shows the precise speed in megahertz for the processor to the thousandths decimal place.
cache size
— Displays the amount of level 2 memory cache available to the processor.
siblings
— Displays the number of sibling CPUs on the same physical CPU for architectures which use hyper-threading.
flags
— Defines a number of different qualities about the processor, such as the presence of a floating point unit (FPU) and the ability to process MMX instructions.
/proc/crypto
/proc/crypto
file looks like the following:
name : sha1 module : kernel type : digest blocksize : 64 digestsize : 20 name : md5 module : md5 type : digest blocksize : 64 digestsize : 16
/proc/devices
Character devices: 1 mem 4 /dev/vc/0 4 tty 4 ttyS 5 /dev/tty 5 /dev/console 5 /dev/ptmx 7 vcs 10 misc 13 input 29 fb 36 netlink 128 ptm 136 pts 180 usb Block devices: 1 ramdisk 3 ide0 9 md 22 ide1 253 device-mapper 254 mdp
/proc/devices
includes the major number and name of the device, and is broken into two major sections: Character devices
and Block devices
.
/usr/share/doc/kernel-doc-<version>
/Documentation/devices.txt
/proc/dma
/proc/dma
files looks like the following:
4: cascade
/proc/execdomains
0-0 Linux [kernel]
PER_LINUX
execution domain, different personalities can be implemented as dynamically loadable modules.
/proc/fb
/proc/fb
for systems which contain frame buffer devices looks similar to the following:
0 VESA VGA
/proc/filesystems
/proc/filesystems
file looks similar to the following:
nodev sysfs nodev rootfs nodev bdev nodev proc nodev sockfs nodev binfmt_misc nodev usbfs nodev usbdevfs nodev futexfs nodev tmpfs nodev pipefs nodev eventpollfs nodev devpts ext2 nodev ramfs nodev hugetlbfs iso9660 nodev mqueue ext3 nodev rpc_pipefs nodev autofs
nodev
are not mounted on a device. The second column lists the names of the file systems supported.
mount
command cycles through the file systems listed here when one is not specified as an argument.
/proc/interrupts
/proc/interrupts
looks similar to the following:
CPU0 0: 80448940 XT-PIC timer 1: 174412 XT-PIC keyboard 2: 0 XT-PIC cascade 8: 1 XT-PIC rtc 10: 410964 XT-PIC eth0 12: 60330 XT-PIC PS/2 Mouse 14: 1314121 XT-PIC ide0 15: 5195422 XT-PIC ide1 NMI: 0 ERR: 0
CPU0 CPU1 0: 1366814704 0 XT-PIC timer 1: 128 340 IO-APIC-edge keyboard 2: 0 0 XT-PIC cascade 8: 0 1 IO-APIC-edge rtc 12: 5323 5793 IO-APIC-edge PS/2 Mouse 13: 1 0 XT-PIC fpu 16: 11184294 15940594 IO-APIC-level Intel EtherExpress Pro 10/100 Ethernet 20: 8450043 11120093 IO-APIC-level megaraid 30: 10432 10722 IO-APIC-level aic7xxx 31: 23 22 IO-APIC-level aic7xxx NMI: 0 ERR: 0
XT-PIC
— This is the old AT computer interrupts.
IO-APIC-edge
— The voltage signal on this interrupt transitions from low to high, creating an edge, where the interrupt occurs and is only signaled once. This kind of interrupt, as well as the IO-APIC-level
interrupt, are only seen on systems with processors from the 586 family and higher.
IO-APIC-level
— Generates interrupts when its voltage signal is high until the signal is low again.
/proc/iomem
00000000-0009fbff : System RAM 0009fc00-0009ffff : reserved 000a0000-000bffff : Video RAM area 000c0000-000c7fff : Video ROM 000f0000-000fffff : System ROM 00100000-07ffffff : System RAM 00100000-00291ba8 : Kernel code 00291ba9-002e09cb : Kernel data e0000000-e3ffffff : VIA Technologies, Inc. VT82C597 [Apollo VP3] e4000000-e7ffffff : PCI Bus #01 e4000000-e4003fff : Matrox Graphics, Inc. MGA G200 AGP e5000000-e57fffff : Matrox Graphics, Inc. MGA G200 AGP e8000000-e8ffffff : PCI Bus #01 e8000000-e8ffffff : Matrox Graphics, Inc. MGA G200 AGP ea000000-ea00007f : Digital Equipment Corporation DECchip 21140 [FasterNet] ea000000-ea00007f : tulip ffff0000-ffffffff : reserved
/proc/ioports
/proc/ioports
provides a list of currently registered port regions used for input or output communication with a device. This file can be quite long. The following is a partial listing:
0000-001f : dma1 0020-003f : pic1 0040-005f : timer 0060-006f : keyboard 0070-007f : rtc 0080-008f : dma page reg 00a0-00bf : pic2 00c0-00df : dma2 00f0-00ff : fpu 0170-0177 : ide1 01f0-01f7 : ide0 02f8-02ff : serial(auto) 0376-0376 : ide1 03c0-03df : vga+ 03f6-03f6 : ide0 03f8-03ff : serial(auto) 0cf8-0cff : PCI conf1 d000-dfff : PCI Bus #01 e000-e00f : VIA Technologies, Inc. Bus Master IDE e000-e007 : ide0 e008-e00f : ide1 e800-e87f : Digital Equipment Corporation DECchip 21140 [FasterNet] e800-e87f : tulip
/proc/kcore
/proc/
files, kcore
displays a size. This value is given in bytes and is equal to the size of the physical memory (RAM) used plus 4 KB.
gdb
, and is not human readable.
/proc/kcore
virtual file. The contents of the file scramble text output on the terminal. If this file is accidentally viewed, press Ctrl+C to stop the process and then type reset
to bring back the command line prompt.
/proc/kmsg
/sbin/klogd
or /bin/dmesg
.
/proc/loadavg
uptime
and other commands. A sample /proc/loadavg
file looks similar to the following:
0.20 0.18 0.12 1/80 11206
/proc/locks
/proc/locks
file for a lightly loaded system looks similar to the following:
1: POSIX ADVISORY WRITE 3568 fd:00:2531452 0 EOF 2: FLOCK ADVISORY WRITE 3517 fd:00:2531448 0 EOF 3: POSIX ADVISORY WRITE 3452 fd:00:2531442 0 EOF 4: POSIX ADVISORY WRITE 3443 fd:00:2531440 0 EOF 5: POSIX ADVISORY WRITE 3326 fd:00:2531430 0 EOF 6: POSIX ADVISORY WRITE 3175 fd:00:2531425 0 EOF 7: POSIX ADVISORY WRITE 3056 fd:00:2548663 0 EOF
FLOCK
signifying the older-style UNIX file locks from a flock
system call and POSIX
representing the newer POSIX locks from the lockf
system call.
ADVISORY
or MANDATORY
. ADVISORY
means that the lock does not prevent other people from accessing the data; it only prevents other attempts to lock it. MANDATORY
means that no other access to the data is permitted while the lock is held. The fourth column reveals whether the lock is allowing the holder READ
or WRITE
access to the file. The fifth column shows the ID of the process holding the lock. The sixth column shows the ID of the file being locked, in the format of MAJOR-DEVICE
:MINOR-DEVICE
:INODE-NUMBER
. The seventh and eighth column shows the start and end of the file's locked region.
/proc/mdstat
/proc/mdstat
looks similar to the following:
Personalities : read_ahead not set unused devices: <none>
md
device is present. In that case, view /proc/mdstat
to find the current status of mdX
RAID devices.
/proc/mdstat
file below shows a system with its md0
configured as a RAID 1 device, while it is currently re-syncing the disks:
Personalities : [linear] [raid1] read_ahead 1024 sectors md0: active raid1 sda2[1] sdb2[0] 9940 blocks [2/2] [UU] resync=1% finish=12.3min algorithm 2 [3/3] [UUU] unused devices: <none>
/proc/meminfo
/proc/
directory, as it reports a large amount of valuable information about the systems RAM usage.
/proc/meminfo
virtual file is from a system with 256 MB of RAM and 512 MB of swap space:
MemTotal: 255908 kB MemFree: 69936 kB Buffers: 15812 kB Cached: 115124 kB SwapCached: 0 kB Active: 92700 kB Inactive: 63792 kB HighTotal: 0 kB HighFree: 0 kB LowTotal: 255908 kB LowFree: 69936 kB SwapTotal: 524280 kB SwapFree: 524280 kB Dirty: 4 kB Writeback: 0 kB Mapped: 42236 kB Slab: 25912 kB Committed_AS: 118680 kB PageTables: 1236 kB VmallocTotal: 3874808 kB VmallocUsed: 1416 kB VmallocChunk: 3872908 kB HugePages_Total: 0 HugePages_Free: 0 Hugepagesize: 4096 kB
free
, top
, and ps
commands. In fact, the output of the free
command is similar in appearance to the contents and structure of /proc/meminfo
. But by looking directly at /proc/meminfo
, more details are revealed:
MemTotal
— Total amount of physical RAM, in kilobytes.
MemFree
— The amount of physical RAM, in kilobytes, left unused by the system.
Buffers
— The amount of physical RAM, in kilobytes, used for file buffers.
Cached
— The amount of physical RAM, in kilobytes, used as cache memory.
SwapCached
— The amount of swap, in kilobytes, used as cache memory.
Active
— The total amount of buffer or page cache memory, in kilobytes, that is in active use. This is memory that has been recently used and is usually not reclaimed for other purposes.
Inactive
— The total amount of buffer or page cache memory, in kilobytes, that are free and available. This is memory that has not been recently used and can be reclaimed for other purposes.
HighTotal
and HighFree
— The total and free amount of memory, in kilobytes, that is not directly mapped into kernel space. The HighTotal
value can vary based on the type of kernel used.
LowTotal
and LowFree
— The total and free amount of memory, in kilobytes, that is directly mapped into kernel space. The LowTotal
value can vary based on the type of kernel used.
SwapTotal
— The total amount of swap available, in kilobytes.
SwapFree
— The total amount of swap free, in kilobytes.
Dirty
— The total amount of memory, in kilobytes, waiting to be written back to the disk.
Writeback
— The total amount of memory, in kilobytes, actively being written back to the disk.
Mapped
— The total amount of memory, in kilobytes, which have been used to map devices, files, or libraries using the mmap
command.
Slab
— The total amount of memory, in kilobytes, used by the kernel to cache data structures for its own use.
Committed_AS
— The total amount of memory, in kilobytes, estimated to complete the workload. This value represents the worst case scenario value, and also includes swap memory.
PageTables
— The total amount of memory, in kilobytes, dedicated to the lowest page table level.
VMallocTotal
— The total amount of memory, in kilobytes, of total allocated virtual address space.
VMallocUsed
— The total amount of memory, in kilobytes, of used virtual address space.
VMallocChunk
— The largest contiguous block of memory, in kilobytes, of available virtual address space.
HugePages_Total
— The total number of hugepages for the system. The number is derived by dividing Hugepagesize
by the megabytes set aside for hugepages specified in /proc/sys/vm/hugetlb_pool
. This statistic only appears on the x86, Itanium, and AMD64 architectures.
HugePages_Free
— The total number of hugepages available for the system. This statistic only appears on the x86, Itanium, and AMD64 architectures.
Hugepagesize
— The size for each hugepages unit in kilobytes. By default, the value is 4096 KB on uniprocessor kernels for 32 bit architectures. For SMP, hugemem kernels, and AMD64, the default is 2048 KB. For Itanium architectures, the default is 262144 KB. This statistic only appears on the x86, Itanium, and AMD64 architectures.
/proc/misc
63 device-mapper 175 agpgart 135 rtc 134 apm_bios
/proc/modules
/proc/modules
file output:
/sbin/lsmod
command.
nfs 170109 0 - Live 0x129b0000 lockd 51593 1 nfs, Live 0x128b0000 nls_utf8 1729 0 - Live 0x12830000 vfat 12097 0 - Live 0x12823000 fat 38881 1 vfat, Live 0x1287b000 autofs4 20293 2 - Live 0x1284f000 sunrpc 140453 3 nfs,lockd, Live 0x12954000 3c59x 33257 0 - Live 0x12871000 uhci_hcd 28377 0 - Live 0x12869000 md5 3777 1 - Live 0x1282c000 ipv6 211845 16 - Live 0x128de000 ext3 92585 2 - Live 0x12886000 jbd 65625 1 ext3, Live 0x12857000 dm_mod 46677 3 - Live 0x12833000
Live
, Loading
, or Unloading
are the only possible values.
oprofile
.
/proc/mounts
rootfs / rootfs rw 0 0 /proc /proc proc rw,nodiratime 0 0 none /dev ramfs rw 0 0 /dev/mapper/VolGroup00-LogVol00 / ext3 rw 0 0 none /dev ramfs rw 0 0 /proc /proc proc rw,nodiratime 0 0 /sys /sys sysfs rw 0 0 none /dev/pts devpts rw 0 0 usbdevfs /proc/bus/usb usbdevfs rw 0 0 /dev/hda1 /boot ext3 rw 0 0 none /dev/shm tmpfs rw 0 0 none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0 sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0
/etc/mtab
, except that /proc/mount
is more up-to-date.
ro
) or read-write (rw
). The fifth and sixth columns are dummy values designed to match the format used in /etc/mtab
.
/proc/mtrr
/proc/mtrr
file may look similar to the following:
reg00: base=0x00000000 ( 0MB), size= 256MB: write-back, count=1 reg01: base=0xe8000000 (3712MB), size= 32MB: write-combining, count=1
/proc/mtrr
file can increase performance more than 150%.
/usr/share/doc/kernel-doc-<version>
/Documentation/mtrr.txt
/proc/partitions
major minor #blocks name 3 0 19531250 hda 3 1 104391 hda1 3 2 19422585 hda2 253 0 22708224 dm-0 253 1 524288 dm-1
major
— The major number of the device with this partition. The major number in the /proc/partitions
, (3
), corresponds with the block device ide0
, in /proc/devices
.
minor
— The minor number of the device with this partition. This serves to separate the partitions into different physical devices and relates to the number at the end of the name of the partition.
#blocks
— Lists the number of physical disk blocks contained in a particular partition.
name
— The name of the partition.
/proc/pci
/proc/pci
can be rather long. A sampling of this file from a basic system looks similar to the following:
Bus 0, device 0, function 0: Host bridge: Intel Corporation 440BX/ZX - 82443BX/ZX Host bridge (rev 3). Master Capable. Latency=64. Prefetchable 32 bit memory at 0xe4000000 [0xe7ffffff]. Bus 0, device 1, function 0: PCI bridge: Intel Corporation 440BX/ZX - 82443BX/ZX AGP bridge (rev 3). Master Capable. Latency=64. Min Gnt=128. Bus 0, device 4, function 0: ISA bridge: Intel Corporation 82371AB PIIX4 ISA (rev 2). Bus 0, device 4, function 1: IDE interface: Intel Corporation 82371AB PIIX4 IDE (rev 1). Master Capable. Latency=32. I/O at 0xd800 [0xd80f]. Bus 0, device 4, function 2: USB Controller: Intel Corporation 82371AB PIIX4 USB (rev 1). IRQ 5. Master Capable. Latency=32. I/O at 0xd400 [0xd41f]. Bus 0, device 4, function 3: Bridge: Intel Corporation 82371AB PIIX4 ACPI (rev 2). IRQ 9. Bus 0, device 9, function 0: Ethernet controller: Lite-On Communications Inc LNE100TX (rev 33). IRQ 5. Master Capable. Latency=32. I/O at 0xd000 [0xd0ff]. Bus 0, device 12, function 0: VGA compatible controller: S3 Inc. ViRGE/DX or /GX (rev 1). IRQ 11. Master Capable. Latency=32. Min Gnt=4.Max Lat=255.
lspci -vb
/proc/slabinfo
/proc/slabinfo
file manually, the /usr/bin/slabtop
program displays kernel slab cache information in real time. This program allows for custom configurations, including column sorting and screen refreshing.
/usr/bin/slabtop
usually looks like the following example:
Active / Total Objects (% used) : 133629 / 147300 (90.7%) Active / Total Slabs (% used) : 11492 / 11493 (100.0%) Active / Total Caches (% used) : 77 / 121 (63.6%) Active / Total Size (% used) : 41739.83K / 44081.89K (94.7%) Minimum / Average / Maximum Object : 0.01K / 0.30K / 128.00K OBJS ACTIVE USE OBJ SIZE SLABS OBJ/SLAB CACHE SIZE NAME 44814 43159 96% 0.62K 7469 6 29876K ext3_inode_cache 36900 34614 93% 0.05K 492 75 1968K buffer_head 35213 33124 94% 0.16K 1531 23 6124K dentry_cache 7364 6463 87% 0.27K 526 14 2104K radix_tree_node 2585 1781 68% 0.08K 55 47 220K vm_area_struct 2263 2116 93% 0.12K 73 31 292K size-128 1904 1125 59% 0.03K 16 119 64K size-32 1666 768 46% 0.03K 14 119 56K anon_vma 1512 1482 98% 0.44K 168 9 672K inode_cache 1464 1040 71% 0.06K 24 61 96K size-64 1320 820 62% 0.19K 66 20 264K filp 678 587 86% 0.02K 3 226 12K dm_io 678 587 86% 0.02K 3 226 12K dm_tio 576 574 99% 0.47K 72 8 288K proc_inode_cache 528 514 97% 0.50K 66 8 264K size-512 492 372 75% 0.09K 12 41 48K bio 465 314 67% 0.25K 31 15 124K size-256 452 331 73% 0.02K 2 226 8K biovec-1 420 420 100% 0.19K 21 20 84K skbuff_head_cache 305 256 83% 0.06K 5 61 20K biovec-4 290 4 1% 0.01K 1 290 4K revoke_table 264 264 100% 4.00K 264 1 1056K size-4096 260 256 98% 0.19K 13 20 52K biovec-16 260 256 98% 0.75K 52 5 208K biovec-64
/proc/slabinfo
that are included into /usr/bin/slabtop
include:
OBJS
— The total number of objects (memory blocks), including those in use (allocated), and some spares not in use.
ACTIVE
— The number of objects (memory blocks) that are in use (allocated).
USE
— Percentage of total objects that are active. ((ACTIVE/OBJS)(100))
OBJ SIZE
— The size of the objects.
SLABS
— The total number of slabs.
OBJ/SLAB
— The number of objects that fit into a slab.
CACHE SIZE
— The cache size of the slab.
NAME
— The name of the slab.
/usr/bin/slabtop
program, refer to the slabtop
man page.
/proc/stat
/proc/stat
, which can be quite long, usually begins like the following example:
cpu 259246 7001 60190 34250993 137517 772 0 cpu0 259246 7001 60190 34250993 137517 772 0 intr 354133732 347209999 2272 0 4 4 0 0 3 1 1249247 0 0 80143 0 422626 5169433 ctxt 12547729 btime 1093631447 processes 130523 procs_running 1 procs_blocked 0 preempt 5651840 cpu 209841 1554 21720 118519346 72939 154 27168 cpu0 42536 798 4841 14790880 14778 124 3117 cpu1 24184 569 3875 14794524 30209 29 3130 cpu2 28616 11 2182 14818198 4020 1 3493 cpu3 35350 6 2942 14811519 3045 0 3659 cpu4 18209 135 2263 14820076 12465 0 3373 cpu5 20795 35 1866 14825701 4508 0 3615 cpu6 21607 0 2201 14827053 2325 0 3334 cpu7 18544 0 1550 14831395 1589 0 3447 intr 15239682 14857833 6 0 6 6 0 5 0 1 0 0 0 29 0 2 0 0 0 0 0 0 0 94982 0 286812 ctxt 4209609 btime 1078711415 processes 21905 procs_running 1 procs_blocked 0
cpu
— Measures the number of jiffies (1/100 of a second for x86 systems) that the system has been in user mode, user mode with low priority (nice), system mode, idle task, I/O wait, IRQ (hardirq), and softirq respectively. The IRQ (hardirq) is the direct response to a hardware event. The IRQ takes minimal work for queuing the "heavy" work up for the softirq to execute. The softirq runs at a lower priority than the IRQ and therefore may be interrupted more frequently. The total for all CPUs is given at the top, while each individual CPU is listed below with its own statistics. The following example is a 4-way Intel Pentium Xeon configuration with multi-threading enabled, therefore showing four physical processors and four virtual processors totaling eight processors.
page
— The number of memory pages the system has written in and out to disk.
swap
— The number of swap pages the system has brought in and out.
intr
— The number of interrupts the system has experienced.
btime
— The boot time, measured in the number of seconds since January 1, 1970, otherwise known as the epoch.
/proc/swaps
/proc/swaps
may look similar to the following:
Filename Type Size Used Priority /dev/mapper/VolGroup00-LogVol01 partition 524280 0 -1
/proc/
directory, /proc/swaps
provides a snapshot of every swap file name, the type of swap space, the total size, and the amount of space in use (in kilobytes). The priority column is useful when multiple swap files are in use. The lower the priority, the more likely the swap file is to be used.
/proc/sysrq-trigger
echo
command to write to this file, a remote root user can execute most System Request Key commands remotely as if at the local terminal. To echo
values to this file, the /proc/sys/kernel/sysrq
must be set to a value other than 0
. For more information about the System Request Key, refer to 4.3.9.3절. “ /proc/sys/kernel/
”.
/proc/uptime
/proc/uptime
is quite minimal:
350735.47 234388.90
/proc/version
gcc
in use, as well as the version of Red Hat Enterprise Linux installed on the system:
Linux version 2.6.8-1.523 (user@foo.redhat.com) (gcc version 3.4.1 20040714 \ (Red Hat Enterprise Linux 3.4.1-7)) #1 Mon Aug 16 13:27:03 EDT 2004
/proc/
/proc/
directory.
/proc/
directory contains a number of directories with numerical names. A listing of them may be similar to the following:
dr-xr-xr-x 3 root root 0 Feb 13 01:28 1 dr-xr-xr-x 3 root root 0 Feb 13 01:28 1010 dr-xr-xr-x 3 xfs xfs 0 Feb 13 01:28 1087 dr-xr-xr-x 3 daemon daemon 0 Feb 13 01:28 1123 dr-xr-xr-x 3 root root 0 Feb 13 01:28 11307 dr-xr-xr-x 3 apache apache 0 Feb 13 01:28 13660 dr-xr-xr-x 3 rpc rpc 0 Feb 13 01:28 637 dr-xr-xr-x 3 rpcuser rpcuser 0 Feb 13 01:28 666
/proc/
process directory vanishes.
cmdline
— Contains the command issued when starting the process.
cwd
— A symbolic link to the current working directory for the process.
environ
— A list of the environment variables for the process. The environment variable is given in all upper-case characters, and the value is in lower-case characters.
exe
— A symbolic link to the executable of this process.
fd
— A directory containing all of the file descriptors for a particular process. These are given in numbered links:
total 0 lrwx------ 1 root root 64 May 8 11:31 0 -> /dev/null lrwx------ 1 root root 64 May 8 11:31 1 -> /dev/null lrwx------ 1 root root 64 May 8 11:31 2 -> /dev/null lrwx------ 1 root root 64 May 8 11:31 3 -> /dev/ptmx lrwx------ 1 root root 64 May 8 11:31 4 -> socket:[7774817] lrwx------ 1 root root 64 May 8 11:31 5 -> /dev/ptmx lrwx------ 1 root root 64 May 8 11:31 6 -> socket:[7774829] lrwx------ 1 root root 64 May 8 11:31 7 -> /dev/ptmx
maps
— A list of memory maps to the various executables and library files associated with this process. This file can be rather long, depending upon the complexity of the process, but sample output from the sshd
process begins like the following:
08048000-08086000 r-xp 00000000 03:03 391479 /usr/sbin/sshd 08086000-08088000 rw-p 0003e000 03:03 391479 /usr/sbin/sshd 08088000-08095000 rwxp 00000000 00:00 0 40000000-40013000 r-xp 0000000 03:03 293205 /lib/ld-2.2.5.so 40013000-40014000 rw-p 00013000 03:03 293205 /lib/ld-2.2.5.so 40031000-40038000 r-xp 00000000 03:03 293282 /lib/libpam.so.0.75 40038000-40039000 rw-p 00006000 03:03 293282 /lib/libpam.so.0.75 40039000-4003a000 rw-p 00000000 00:00 0 4003a000-4003c000 r-xp 00000000 03:03 293218 /lib/libdl-2.2.5.so 4003c000-4003d000 rw-p 00001000 03:03 293218 /lib/libdl-2.2.5.so
mem
— The memory held by the process. This file cannot be read by the user.
root
— A link to the root directory of the process.
stat
— The status of the process.
statm
— The status of the memory in use by the process. Below is a sample /proc/statm
file:
263 210 210 5 0 205 0
status
— The status of the process in a more readable form than stat
or statm
. Sample output for sshd
looks similar to the following:
Name: sshd State: S (sleeping) Tgid: 797 Pid: 797 PPid: 1 TracerPid: 0 Uid: 0 0 0 0 Gid: 0 0 0 0 FDSize: 32 Groups: VmSize: 3072 kB VmLck: 0 kB VmRSS: 840 kB VmData: 104 kB VmStk: 12 kB VmExe: 300 kB VmLib: 2528 kB SigPnd: 0000000000000000 SigBlk: 0000000000000000 SigIgn: 8000000000001000 SigCgt: 0000000000014005 CapInh: 0000000000000000 CapPrm: 00000000fffffeff CapEff: 00000000fffffeff
S (sleeping)
or R (running)
), user/group ID running the process, and detailed data regarding memory usage.
/proc/self/
/proc/self/
directory is a link to the currently running process. This allows a process to look at itself without having to know its process ID.
/proc/self/
directory produces the same contents as listing the process directory for that process.
/proc/bus/
/proc/bus/
by the same name, such as /proc/bus/pci/
.
/proc/bus/
vary depending on the devices connected to the system. However, each bus type has at least one directory. Within these bus directories are normally at least one subdirectory with a numerical name, such as 001
, which contain binary files.
/proc/bus/usb/
subdirectory contains files that track the various devices on any USB buses, as well as the drivers required for them. The following is a sample listing of a /proc/bus/usb/
directory:
total 0 dr-xr-xr-x 1 root root 0 May 3 16:25 001 -r--r--r-- 1 root root 0 May 3 16:25 devices -r--r--r-- 1 root root 0 May 3 16:25 drivers
/proc/bus/usb/001/
directory contains all devices on the first USB bus and the devices
file identifies the USB root hub on the motherboard.
/proc/bus/usb/devices
file:
T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0 D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=0000 ProdID=0000 Rev= 0.00 S: Product=USB UHCI Root Hub S: SerialNumber=d400 C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms
/proc/driver/
rtc
which provides output from the driver for the system's Real Time Clock (RTC), the device that keeps the time while the system is switched off. Sample output from /proc/driver/rtc
looks like the following:
rtc_time : 16:21:00 rtc_date : 2004-08-31 rtc_epoch : 1900 alarm : 21:16:27 DST_enable : no BCD : yes 24hr : yes square_wave : no alarm_IRQ : no update_IRQ : no periodic_IRQ : no periodic_freq : 1024 batt_status : okay
/usr/share/doc/kernel-doc-<version>
/Documentation/rtc.txt
.
/proc/fs
cat /proc/fs/nfsd/exports
displays the file systems being shared and the permissions granted for those file systems. For more on file system sharing with NFS, refer to 20장. 네트워크 파일 시스템 (NFS).
/proc/ide/
/proc/ide/ide0
and /proc/ide/ide1
. In addition, a drivers
file is available, providing the version number of the various drivers used on the IDE channels:
ide-floppy version 0.99. newide ide-cdrom version 4.61 ide-disk version 1.18
/proc/ide/piix
file which reveals whether DMA or UDMA is enabled for the devices on the IDE channels:
Intel PIIX4 Ultra 33 Chipset. ------------- Primary Channel ---------------- Secondary Channel ------------- enabled enabled ------------- drive0 --------- drive1 -------- drive0 ---------- drive1 ------ DMA enabled: yes no yes no UDMA enabled: yes no no no UDMA enabled: 2 X X X UDMA DMA PIO
ide0
, provides additional information. The channel
file provides the channel number, while the model
identifies the bus type for the channel (such as pci
).
/dev/
directory. For instance, the first IDE drive on ide0
would be hda
.
/proc/ide/
directory.
cache
— The device cache.
capacity
— The capacity of the device, in 512 byte blocks.
driver
— The driver and version used to control the device.
geometry
— The physical and logical geometry of the device.
media
— The type of device, such as a disk
.
model
— The model name or number of the device.
settings
— A collection of current device parameters. This file usually contains quite a bit of useful, technical information. A sample settings
file for a standard IDE hard disk looks similar to the following:
name value min max mode ---- ----- --- --- ---- acoustic 0 0 254 rw address 0 0 2 rw bios_cyl 38752 0 65535 rw bios_head 16 0 255 rw bios_sect 63 0 63 rw bswap 0 0 1 r current_speed 68 0 70 rw failures 0 0 65535 rw init_speed 68 0 70 rw io_32bit 0 0 3 rw keepsettings 0 0 1 rw lun 0 0 7 rw max_failures 1 0 65535 rw multcount 16 0 16 rw nice1 1 0 1 rw nowerr 0 0 1 rw number 0 0 3 rw pio_mode write-only 0 255 w unmaskirq 0 0 1 rw using_dma 1 0 1 rw wcache 1 0 1 rw
/proc/irq/
/proc/irq/prof_cpu_mask
file is a bitmask that contains the default values for the smp_affinity
file in the IRQ directory. The values in smp_affinity
specify which CPUs handle that particular IRQ.
/proc/irq/
directory, refer to the following installed documentation:
/usr/share/doc/kernel-doc-<version>
/Documentation/filesystems/proc.txt
/proc/net/
/proc/net/
directory:
arp
— Lists the kernel's ARP table. This file is particularly useful for connecting a hardware address to an IP address on a system.
atm/
directory — The files within this directory contain Asynchronous Transfer Mode (ATM) settings and statistics. This directory is primarily used with ATM networking and ADSL cards.
dev
— Lists the various network devices configured on the system, complete with transmit and receive statistics. This file displays the number of bytes each interface has sent and received, the number of packets inbound and outbound, the number of errors seen, the number of packets dropped, and more.
dev_mcast
— Lists Layer2 multicast groups on which each device is listening.
igmp
— Lists the IP multicast addresses which this system joined.
ip_conntrack
— Lists tracked network connections for machines that are forwarding IP connections.
ip_tables_names
— Lists the types of iptables
in use. This file is only present if iptables
is active on the system and contains one or more of the following values: filter
, mangle
, or nat
.
ip_mr_cache
— Lists the multicast routing cache.
ip_mr_vif
— Lists multicast virtual interfaces.
netstat
— Contains a broad yet detailed collection of networking statistics, including TCP timeouts, SYN cookies sent and received, and much more.
psched
— Lists global packet scheduler parameters.
raw
— Lists raw device statistics.
route
— Lists the kernel's routing table.
rt_cache
— Contains the current routing cache.
snmp
— List of Simple Network Management Protocol (SNMP) data for various networking protocols in use.
sockstat
— Provides socket statistics.
tcp
— Contains detailed TCP socket information.
tr_rif
— Lists the token ring RIF routing table.
udp
— Contains detailed UDP socket information.
unix
— Lists UNIX domain sockets currently in use.
wireless
— Lists wireless interface data.
/proc/scsi/
/proc/ide/
directory, but it is for connected SCSI devices.
/proc/scsi/scsi
, which contains a list of every recognized SCSI device. From this listing, the type of device, as well as the model name, vendor, SCSI channel and ID data is available.
Attached devices: Host: scsi1 Channel: 00 Id: 05 Lun: 00 Vendor: NEC Model: CD-ROM DRIVE:466 Rev: 1.06 Type: CD-ROM ANSI SCSI revision: 02 Host: scsi1 Channel: 00 Id: 06 Lun: 00 Vendor: ARCHIVE Model: Python 04106-XXX Rev: 7350 Type: Sequential-Access ANSI SCSI revision: 02 Host: scsi2 Channel: 00 Id: 06 Lun: 00 Vendor: DELL Model: 1x6 U2W SCSI BP Rev: 5.35 Type: Processor ANSI SCSI revision: 02 Host: scsi2 Channel: 02 Id: 00 Lun: 00 Vendor: MegaRAID Model: LD0 RAID5 34556R Rev: 1.01 Type: Direct-Access ANSI SCSI revision: 02
/proc/scsi/
, which contains files specific to each SCSI controller using that driver. From the previous example, aic7xxx/
and megaraid/
directories are present, since two drivers are in use. The files in each of the directories typically contain an I/O address range, IRQ information, and statistics for the SCSI controller using that driver. Each controller can report a different type and amount of information. The Adaptec AIC-7880 Ultra SCSI host adapter's file in this example system produces the following output:
Adaptec AIC7xxx driver version: 5.1.20/3.2.4 Compile Options: TCQ Enabled By Default : Disabled AIC7XXX_PROC_STATS : Enabled AIC7XXX_RESET_DELAY : 5 Adapter Configuration: SCSI Adapter: Adaptec AIC-7880 Ultra SCSI host adapter Ultra Narrow Controller PCI MMAPed I/O Base: 0xfcffe000 Adapter SEEPROM Config: SEEPROM found and used. Adaptec SCSI BIOS: Enabled IRQ: 30 SCBs: Active 0, Max Active 1, Allocated 15, HW 16, Page 255 Interrupts: 33726 BIOS Control Word: 0x18a6 Adapter Control Word: 0x1c5f Extended Translation: Enabled Disconnect Enable Flags: 0x00ff Ultra Enable Flags: 0x0020 Tag Queue Enable Flags: 0x0000 Ordered Queue Tag Flags: 0x0000 Default Tag Queue Depth: 8 Tagged Queue By Device array for aic7xxx host instance 1: {255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255} Actual queue depth per device for aic7xxx host instance 1: {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1} Statistics: (scsi1:0:5:0) Device using Narrow/Sync transfers at 20.0 MByte/sec, offset 15 Transinfo settings: current(12/15/0/0), goal(12/15/0/0), user(12/15/0/0) Total transfers 0 (0 reads and 0 writes) < 2K 2K+ 4K+ 8K+ 16K+ 32K+ 64K+ 128K+ Reads: 0 0 0 0 0 0 0 0 Writes: 0 0 0 0 0 0 0 0 (scsi1:0:6:0) Device using Narrow/Sync transfers at 10.0 MByte/sec, offset 15 Transinfo settings: current(25/15/0/0), goal(12/15/0/0), user(12/15/0/0) Total transfers 132 (0 reads and 132 writes) < 2K 2K+ 4K+ 8K+ 16K+ 32K+ 64K+ 128K+ Reads: 0 0 0 0 0 0 0 0 Writes: 0 0 0 1 131 0 0 0
/proc/sys/
/proc/sys/
directory is different from others in /proc/
because it not only provides information about the system but also allows the system administrator to immediately enable and disable kernel features.
/proc/sys/
directory. Changing the wrong setting may render the kernel unstable, requiring a system reboot.
/proc/sys/
.
-l
option at the shell prompt. If the file is writable, it may be used to configure the kernel. For example, a partial listing of /proc/sys/fs
looks like the following:
-r--r--r-- 1 root root 0 May 10 16:14 dentry-state -rw-r--r-- 1 root root 0 May 10 16:14 dir-notify-enable -r--r--r-- 1 root root 0 May 10 16:14 dquot-nr -rw-r--r-- 1 root root 0 May 10 16:14 file-max -r--r--r-- 1 root root 0 May 10 16:14 file-nr
dir-notify-enable
and file-max
can be written to and, therefore, can be used to configure the kernel. The other files only provide feedback on current settings.
/proc/sys/
file is done by echoing the new value into the file. For example, to enable the System Request Key on a running kernel, type the command:
echo 1 > /proc/sys/kernel/sysrq
sysrq
from 0
(off) to 1
(on).
/proc/sys/
configuration files contain more than one value. To correctly send new values to them, place a space character between each value passed with the echo
command, such as is done in this example:
echo 4 2 45 > /proc/sys/kernel/acct
echo
command disappear when the system is restarted. To make configuration changes take effect after the system is rebooted, refer to 4.4절. “Using the sysctl
Command”.
/proc/sys/
directory contains several subdirectories controlling different aspects of a running kernel.
/proc/sys/dev/
cdrom/
and raid/
. Customized kernels can have other directories, such as parport/
, which provides the ability to share one parallel port between multiple device drivers.
cdrom/
directory contains a file called info
, which reveals a number of important CD-ROM parameters:
CD-ROM information, Id: cdrom.c 3.20 2003/12/17 drive name: hdc drive speed: 48 drive # of slots: 1 Can close tray: 1 Can open tray: 1 Can lock tray: 1 Can change speed: 1 Can select disk: 0 Can read multisession: 1 Can read MCN: 1 Reports media changed: 1 Can play audio: 1 Can write CD-R: 0 Can write CD-RW: 0 Can read DVD: 0 Can write DVD-R: 0 Can write DVD-RAM: 0 Can read MRW: 0 Can write MRW: 0 Can write RAM: 0
/proc/sys/dev/cdrom
, such as autoclose
and checkmedia
, can be used to control the system's CD-ROM. Use the echo
command to enable or disable these features.
/proc/sys/dev/raid/
directory becomes available with at least two files in it: speed_limit_min
and speed_limit_max
. These settings determine the acceleration of RAID devices for I/O intensive tasks, such as resyncing the disks.
/proc/sys/fs/
binfmt_misc/
directory is used to provide kernel support for miscellaneous binary formats.
/proc/sys/fs/
include:
dentry-state
— Provides the status of the directory cache. The file looks similar to the following:
57411 52939 45 0 0 0
dquot-nr
— Lists the maximum number of cached disk quota entries.
file-max
— Lists the maximum number of file handles that the kernel allocates. Raising the value in this file can resolve errors caused by a lack of available file handles.
file-nr
— Lists the number of allocated file handles, used file handles, and the maximum number of file handles.
overflowgid
and overflowuid
— Defines the fixed group ID and user ID, respectively, for use with file systems that only support 16-bit group and user IDs.
super-max
— Controls the maximum number of superblocks available.
super-nr
— Displays the current number of superblocks in use.
/proc/sys/kernel/
acct
— Controls the suspension of process accounting based on the percentage of free space available on the file system containing the log. By default, the file looks like the following:
4 2 30
cap-bound
— Controls the capability bounding settings, which provides a list of capabilities for any process on the system. If a capability is not listed here, then no process, no matter how privileged, can do it. The idea is to make the system more secure by ensuring that certain things cannot happen, at least beyond a certain point in the boot process.
/lib/modules/<kernel-version>
/build/include/linux/capability.h
.
ctrl-alt-del
— Controls whether Ctrl+Alt+Delete gracefully restarts the computer using init
(0
) or forces an immediate reboot without syncing the dirty buffers to disk (1
).
domainname
— Configures the system domain name, such as example.com
.
exec-shield
— Configures the Exec Shield feature of the kernel. Exec Shield provides protection against certain types of buffer overflow attacks.
0
— Disables Exec Shield.
1
— Enables Exec Shield. This is the default value.
exec-shield-randomize
— Enables location randomization of various items in memory. This helps deter potential attackers from locating programs and daemons in memory. Each time a program or daemon starts, it is put into a different memory location each time, never in a static or absolute memory address.
0
— Disables randomization of Exec Shield. This may be useful for application debugging purposes.
1
— Enables randomization of Exec Shield. This is the default value. Note: The exec-shield
file must also be set to 1
for exec-shield-randomize
to be effective.
hostname
— Configures the system hostname, such as www.example.com
.
hotplug
— Configures the utility to be used when a configuration change is detected by the system. This is primarily used with USB and Cardbus PCI. The default value of /sbin/hotplug
should not be changed unless testing a new program to fulfill this role.
modprobe
— Sets the location of the program used to load kernel modules. The default value is /sbin/modprobe
which means kmod
calls it to load the module when a kernel thread calls kmod
.
msgmax
— Sets the maximum size of any message sent from one process to another and is set to 8192
bytes by default. Be careful when raising this value, as queued messages between processes are stored in non-swappable kernel memory. Any increase in msgmax
would increase RAM requirements for the system.
msgmnb
— Sets the maximum number of bytes in a single message queue. The default is 16384
.
msgmni
— Sets the maximum number of message queue identifiers. The default is 16
.
osrelease
— Lists the Linux kernel release number. This file can only be altered by changing the kernel source and recompiling.
ostype
— Displays the type of operating system. By default, this file is set to Linux
, and this value can only be changed by changing the kernel source and recompiling.
overflowgid
and overflowuid
— Defines the fixed group ID and user ID, respectively, for use with system calls on architectures that only support 16-bit group and user IDs.
panic
— Defines the number of seconds the kernel postpones rebooting when the system experiences a kernel panic. By default, the value is set to 0
, which disables automatic rebooting after a panic.
printk
— This file controls a variety of settings related to printing or logging error messages. Each error message reported by the kernel has a loglevel associated with it that defines the importance of the message. The loglevel values break down in this order:
0
— Kernel emergency. The system is unusable.
1
— Kernel alert. Action must be taken immediately.
2
— Condition of the kernel is considered critical.
3
— General kernel error condition.
4
— General kernel warning condition.
5
— Kernel notice of a normal but significant condition.
6
— Kernel informational message.
7
— Kernel debug-level messages.
printk
file:
6 4 1 7
random/
directory — Lists a number of values related to generating random numbers for the kernel.
rtsig-max
— Configures the maximum number of POSIX real-time signals that the system may have queued at any one time. The default value is 1024
.
rtsig-nr
— Lists the current number of POSIX real-time signals queued by the kernel.
sem
— Configures semaphore settings within the kernel. A semaphore is a System V IPC object that is used to control utilization of a particular process.
shmall
— Sets the total amount of shared memory pages that can be used at one time, system-wide. By default, this value is 2097152
.
shmmax
— Sets the largest shared memory segment size allowed by the kernel. By default, this value is 33554432
. However, the kernel supports much larger values than this.
shmmni
— Sets the maximum number of shared memory segments for the whole system. By default, this value is 4096
.
sysrq
— Activates the System Request Key, if this value is set to anything other than zero (0
), the default.
<system request code>
. Replace <system request code>
with one of the following system request codes:
r
— Disables raw mode for the keyboard and sets it to XLATE (a limited keyboard mode which does not recognize modifiers such as Alt, Ctrl, or Shift for all keys).
k
— Kills all processes active in a virtual console. Also called Secure Access Key (SAK), it is often used to verify that the login prompt is spawned from init
and not a Trojan copy designed to capture usernames and passwords.
b
— Reboots the kernel without first unmounting file systems or syncing disks attached to the system.
c
— Crashes the system without first unmounting file systems or syncing disks attached to the system.
o
— Shuts off the system.
s
— Attempts to sync disks attached to the system.
u
— Attempts to unmount and remount all file systems as read-only.
p
— Outputs all flags and registers to the console.
t
— Outputs a list of processes to the console.
m
— Outputs memory statistics to the console.
0
through 9
— Sets the log level for the console.
e
— Kills all processes except init
using SIGTERM.
i
— Kills all processes except init
using SIGKILL.
l
— Kills all processes using SIGKILL (including init
). The system is unusable after issuing this System Request Key code.
h
— Displays help text.
/usr/share/doc/kernel-doc-<version>
/Documentation/sysrq.txt
for more information about the System Request Key.
sysrq-key
— Defines the key code for the System Request Key (84
is the default).
sysrq-sticky
— Defines whether the System Request Key is a chorded key combination. The accepted values are as follows:
0
— Alt+SysRq and the system request code must be pressed simultaneously. This is the default value.
1
— Alt+SysRq must be pressed simultaneously, but the system request code can be pressed anytime before the number of seconds specified in /proc/sys/kernel/sysrq-timer
elapses.
sysrq-timer
— Specifies the number of seconds allowed to pass before the system request code must be pressed. The default value is 10
.
tainted
— Indicates whether a non-GPL module is loaded.
0
— No non-GPL modules are loaded.
1
— At least one module without a GPL license (including modules with no license) is loaded.
2
— At least one module was force-loaded with the command insmod -f
.
threads-max
— Sets the maximum number of threads to be used by the kernel, with a default value of 2048
.
version
— Displays the date and time the kernel was last compiled. The first field in this file, such as #3
, relates to the number of times a kernel was built from the source base.
/proc/sys/net/
ethernet/
, ipv4/
, ipx/
, and ipv6/
. By altering the files within these directories, system administrators are able to adjust the network configuration on a running system.
/proc/sys/net/
directories are discussed.
/proc/sys/net/core/
directory contains a variety of settings that control the interaction between the kernel and networking layers. The most important of these files are:
message_burst
— Sets the amount of time in tenths of a second required to write a new warning message. This setting is used to mitigate Denial of Service (DoS) attacks. The default setting is 50
.
message_cost
— Sets a cost on every warning message. The higher the value of this file (default of 5
), the more likely the warning message is ignored. This setting is used to mitigate DoS attacks.
message_burst
and message_cost
are designed to be modified based on the system's acceptable risk versus the need for comprehensive logging.
netdev_max_backlog
— Sets the maximum number of packets allowed to queue when a particular interface receives packets faster than the kernel can process them. The default value for this file is 300
.
optmem_max
— Configures the maximum ancillary buffer size allowed per socket.
rmem_default
— Sets the receive socket buffer default size in bytes.
rmem_max
— Sets the receive socket buffer maximum size in bytes.
wmem_default
— Sets the send socket buffer default size in bytes.
wmem_max
— Sets the send socket buffer maximum size in bytes.
/proc/sys/net/ipv4/
directory contains additional networking settings. Many of these settings, used in conjunction with one another, are useful in preventing attacks on the system or when using the system to act as a router.
/proc/sys/net/ipv4/
directory:
icmp_destunreach_rate
, icmp_echoreply_rate
, icmp_paramprob_rate
, and icmp_timeexeed_rate
— Set the maximum ICMP send packet rate, in 1/100 of a second, to hosts under certain conditions. A setting of 0
removes any delay and is not a good idea.
icmp_echo_ignore_all
and icmp_echo_ignore_broadcasts
— Allows the kernel to ignore ICMP ECHO packets from every host or only those originating from broadcast and multicast addresses, respectively. A value of 0
allows the kernel to respond, while a value of 1
ignores the packets.
ip_default_ttl
— Sets the default Time To Live (TTL), which limits the number of hops a packet may make before reaching its destination. Increasing this value can diminish system performance.
ip_forward
— Permits interfaces on the system to forward packets to one other. By default, this file is set to 0
. Setting this file to 1
enables network packet forwarding.
ip_local_port_range
— Specifies the range of ports to be used by TCP or UDP when a local port is needed. The first number is the lowest port to be used and the second number specifies the highest port. Any systems that expect to require more ports than the default 1024 to 4999 should use a range from 32768 to 61000.
tcp_syn_retries
— Provides a limit on the number of times the system re-transmits a SYN packet when attempting to make a connection.
tcp_retries1
— Sets the number of permitted re-transmissions attempting to answer an incoming connection. Default of 3
.
tcp_retries2
— Sets the number of permitted re-transmissions of TCP packets. Default of 15
.
/usr/share/doc/kernel-doc-<version>
/Documentation/networking/ ip-sysctl.txt
/proc/sys/net/ipv4/
directory.
/proc/sys/net/ipv4/
directory and each covers a different aspect of the network stack. The /proc/sys/net/ipv4/conf/
directory allows each system interface to be configured in different ways, including the use of default settings for unconfigured devices (in the /proc/sys/net/ipv4/conf/default/
subdirectory) and settings that override all special configurations (in the /proc/sys/net/ipv4/conf/all/
subdirectory).
/proc/sys/net/ipv4/neigh/
directory contains settings for communicating with a host directly connected to the system (called a network neighbor) and also contains different settings for systems more than one hop away.
/proc/sys/net/ipv4/route/
. Unlike conf/
and neigh/
, the /proc/sys/net/ipv4/route/
directory contains specifications that apply to routing with any interfaces on the system. Many of these settings, such as max_size
, max_delay
, and min_delay
, relate to controlling the size of the routing cache. To clear the routing cache, write any value to the flush
file.
/usr/share/doc/kernel-doc-<version>
/Documentation/filesystems/proc.txt
/proc/sys/vm/
/proc/sys/vm/
directory:
block_dump
— Configures block I/O debugging when enabled. All read/write and block dirtying operations done to files are logged accordingly. This can be useful if diagnosing disk spin up and spin downs for laptop battery conservation. All output when block_dump
is enabled can be retrieved via dmesg
. The default value is 0
.
block_dump
is enabled at the same time as kernel debugging, it is prudent to stop the klogd
daemon, as it generates erroneous disk activity caused by block_dump
.
dirty_background_ratio
— Starts background writeback of dirty data at this percentage of total memory, via a pdflush daemon. The default value is 10
.
dirty_expire_centisecs
— Defines when dirty in-memory data is old enough to be eligible for writeout. Data which has been dirty in-memory for longer than this interval is written out next time a pdflush daemon wakes up. The default value is 3000
, expressed in hundredths of a second.
dirty_ratio
— Starts active writeback of dirty data at this percentage of total memory for the generator of dirty data, via pdflush. The default value is 40
.
dirty_writeback_centisecs
— Defines the interval between pdflush daemon wakeups, which periodically writes dirty in-memory data out to disk. The default value is 500
, expressed in hundredths of a second.
laptop_mode
— Minimizes the number of times that a hard disk needs to spin up by keeping the disk spun down for as long as possible, therefore conserving battery power on laptops. This increases efficiency by combining all future I/O processes together, reducing the frequency of spin ups. The default value is 0
, but is automatically enabled in case a battery on a laptop is used.
/usr/share/doc/kernel-doc-<version>
/Documentation/laptop-mode.txt
lower_zone_protection
— Determines how aggressive the kernel is in defending lower memory allocation zones. This is effective when utilized with machines configured with highmem
memory space enabled. The default value is 0
, no protection at all. All other integer values are in megabytes, and lowmem
memory is therefore protected from being allocated by users.
/usr/share/doc/kernel-doc-<version>
/Documentation/filesystems/proc.txt
max_map_count
— Configures the maximum number of memory map areas a process may have. In most cases, the default value of 65536
is appropriate.
min_free_kbytes
— Forces the Linux VM (virtual memory manager) to keep a minimum number of kilobytes free. The VM uses this number to compute a pages_min
value for each lowmem
zone in the system. The default value is in respect to the total memory on the machine.
nr_hugepages
— Indicates the current number of configured hugetlb
pages in the kernel.
/usr/share/doc/kernel-doc-<version>
/Documentation/vm/hugetlbpage.txt
nr_pdflush_threads
— Indicates the number of pdflush daemons that are currently running. This file is read-only, and should not be changed by the user. Under heavy I/O loads, the default value of two is increased by the kernel.
overcommit_memory
— Configures the conditions under which a large memory request is accepted or denied. The following three modes are available:
0
— The kernel performs heuristic memory over commit handling by estimating the amount of memory available and failing requests that are blatantly invalid. Unfortunately, since memory is allocated using a heuristic rather than a precise algorithm, this setting can sometimes allow available memory on the system to be overloaded. This is the default setting.
1
— The kernel performs no memory over commit handling. Under this setting, the potential for memory overload is increased, but so is performance for memory intensive tasks (such as those executed by some scientific software).
2
— The kernel fails requests for memory that add up to all of swap plus the percent of physical RAM specified in /proc/sys/vm/overcommit_ratio
. This setting is best for those who desire less risk of memory overcommitment.
overcommit_ratio
— Specifies the percentage of physical RAM considered when /proc/sys/vm/overcommit_memory
is set to 2
. The default value is 50
.
page-cluster
— Sets the number of pages read in a single attempt. The default value of 3
, which actually relates to 16 pages, is appropriate for most systems.
swappiness
— Determines how much a machine should swap. The higher the value, the more swapping occurs. The default value, as a percentage, is set to 60
.
/usr/share/doc/kernel-doc-<version>
/Documentation/
, which contains additional information.
/proc/sysvipc/
msg
), semaphores (sem
), and shared memory (shm
).
/proc/tty/
drivers
file is a list of the current tty devices in use, as in the following example:
serial /dev/cua 5 64-127 serial:callout serial /dev/ttyS 4 64-127 serial pty_slave /dev/pts 136 0-255 pty:slave pty_master /dev/ptm 128 0-255 pty:master pty_slave /dev/ttyp 3 0-255 pty:slave pty_master /dev/pty 2 0-255 pty:master /dev/vc/0 /dev/vc/0 4 0 system:vtmaster /dev/ptmx /dev/ptmx 5 2 system /dev/console /dev/console 5 1 system:console /dev/tty /dev/tty 5 0 system:/dev/tty unknown /dev/vc/%d 4 1-63 console
/proc/tty/driver/serial
file lists the usage statistics and status of each of the serial tty lines.
ldiscs
file, and more detailed information is available within the ldisc/
directory.
/proc/<PID>/
/proc/sys/vm/panic_on_oom
. When set to 1
the kernel will panic on OOM. A setting of 0
instructs the kernel to call a function named oom_killer
on an OOM. Usually, oom_killer
can kill rogue processes and the system will survive.
/proc/sys/vm/panic_on_oom
.
~]#cat /proc/sys/vm/panic_on_oom
1 ~]#echo 0 > /proc/sys/vm/panic_on_oom
~]#cat /proc/sys/vm/panic_on_oom
0
oom_killer
score. In /proc/<PID>/
there are two tools labelled oom_adj
and oom_score
. Valid scores for oom_adj
are in the range -16 to +15. To see the current oom_killer
score, view the oom_score
for the process. oom_killer
will kill processes with the highest scores first.
oom_killer
will kill it.
~]#cat /proc/12465/oom_score
79872 ~]#echo -5 > /proc/12465/oom_adj
~]#cat /proc/12465/oom_score
78
oom_killer
for that process. In the example below, oom_score
returns a value of 0, indicating that this process would not be killed.
~]#cat /proc/12465/oom_score
78 ~]#echo -17 > /proc/12465/oom_adj
~]#cat /proc/12465/oom_score
0
badness()
is used to determine the actual score for each process. This is done by adding up 'points' for each examined process. The process scoring is done in the following way:
CAP_SYS_ADMIN
and CAP_SYS_RAWIO
capabilities have their scores reduced.
oom_adj
file.
oom_score
value will most probably be a non-privileged, recently started process that, along with its children, uses a large amount of memory, has been 'niced', and handles no raw I/O.
sysctl
Command/sbin/sysctl
command is used to view, set, and automate kernel settings in the /proc/sys/
directory.
/proc/sys/
directory, type the /sbin/sysctl -a
command as root. This creates a large, comprehensive list, a small portion of which looks something like the following:
net.ipv4.route.min_delay = 2 kernel.sysrq = 0 kernel.sem = 250 32000 32 128
/proc/sys/net/ipv4/route/min_delay
file is listed as net.ipv4.route.min_delay
, with the directory slashes replaced by dots and the proc.sys
portion assumed.
sysctl
command can be used in place of echo
to assign values to writable files in the /proc/sys/
directory. For example, instead of using the command
echo 1 > /proc/sys/kernel/sysrq
sysctl
command as follows:
~]# sysctl -w kernel.sysrq="1"
kernel.sysrq = 1
/proc/sys/
is helpful during testing, this method does not work as well on a production system as special settings within /proc/sys/
are lost when the machine is rebooted. To preserve custom settings, add them to the /etc/sysctl.conf
file.
init
program runs the /etc/rc.d/rc.sysinit
script. This script contains a command to execute sysctl
using /etc/sysctl.conf
to determine the values passed to the kernel. Any values added to /etc/sysctl.conf
therefore take effect each time the system boots.
proc
file system.
proc
file system is installed on the system by default.
/usr/share/doc/kernel-doc-<version>
/Documentation/filesystems/proc.txt
— Contains assorted, but limited, information about all aspects of the /proc/
directory.
/usr/share/doc/kernel-doc-<version>
/Documentation/sysrq.txt
— An overview of System Request Key options.
/usr/share/doc/kernel-doc-<version>
/Documentation/sysctl/
— A directory containing a variety of sysctl
tips, including modifying values that concern the kernel (kernel.txt
), accessing file systems (fs.txt
), and virtual memory use (vm.txt
).
/usr/share/doc/kernel-doc-<version>
/Documentation/networking/ip-sysctl.txt
— A detailed overview of IP networking options.
/
) partition exists on two 40G drives, you have 80G total but are only able to access 40G of that 80G. The other 40G acts like a mirror of the first 40G.
/dev/hda
and /dev/hdb
) to illustrate the creation of simple RAID 1 and RAID 0 configurations, and detail how to create a simple RAID configuration by implementing multiple RAID devices.
/boot
partition as a software RAID device, leaving the root partition (/
), /home
, and swap
as regular file systems. 그림 5.4. “RAID 1 Partitions Ready, Pre-Device and Mount Point Creation” shows successfully allocated space for the RAID 1 configuration (for /boot
), which is now ready for RAID device and mount point creation:
/boot
, you must choose RAID level 1, and it must use one of the first two drives (IDE first, SCSI second). If you are not creating a separate RAID partition of /boot
, and you are making a RAID partition for the root file system (that is, /
), it must be RAID level 1 and must use one of the first two drives (IDE first, SCSI second).
/
), home partition (/home
), or swap
.
/proc/mdstat
special file. To list these devices, display the content of this file by typing the following at a shell prompt:
cat
/proc/mdstat
root
:
mdadm
--query
device
…
mdadm
--detail
raid_device
…
mdadm
--examine
component_device
…
mdadm --detail
command displays information about a RAID device, mdadm --examine
only relays information about a RAID device as it relates to a given component device. This distinction is particularly important when working with a RAID device that itself is a component of another RAID device.
mdadm --query
command, as well as both mdadm --detail
and mdadm --examine
commands allow you to specify multiple devices at once.
/dev/md0
is a RAID device by typing the following at a shell prompt:
~]# mdadm --query /dev/md0
/dev/md0: 125.38MiB raid1 2 devices, 0 spares. Use mdadm --detail for more detail.
/dev/md0: No md super block found, not an md component.
~]# mdadm --detail /dev/md0
/dev/md0:
Version : 0.90
Creation Time : Tue Jun 28 16:05:49 2011
Raid Level : raid1
Array Size : 128384 (125.40 MiB 131.47 MB)
Used Dev Size : 128384 (125.40 MiB 131.47 MB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Thu Jun 30 17:06:34 2011
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
UUID : 49c5ac74:c2b79501:5c28cb9c:16a6dd9f
Events : 0.6
Number Major Minor RaidDevice State
0 3 1 0 active sync /dev/hda1
1 3 65 1 active sync /dev/hdb1
~]$ cat /proc/mdstat
Personalities : [raid0] [raid1]
md0 : active raid1 hdb1[1] hda1[0]
128384 blocks [2/2] [UU]
md1 : active raid0 hdb2[1] hda2[0]
1573888 blocks 256k chunks
md2 : active raid0 hdb3[1] hda3[0]
19132928 blocks 256k chunks
unused devices: <none>
root
:
mdadm
--create
raid_device
--level
=level
--raid-devices
=number
component_device
…
mdadm
(8) manual page.
~]# ls /dev/sd*
/dev/sda /dev/sda1 /dev/sdb /dev/sdb1
/dev/md3
as a new RAID level 1 array from /dev/sda1
and /dev/sdb1
, run the following command:
~]# mdadm --create /dev/md3 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1
mdadm: array /dev/md3 started.
root
:
mdadm
raid_device
--fail
component_device
mdadm
raid_device
--remove
component_device
mdadm
raid_device
--add
component_device
/dev/md3
, with the following layout (that is, the RAID device created in 예 5.2. “Creating a new RAID device”):
~]# mdadm --detail /dev/md3 | tail -n 3
Number Major Minor RaidDevice State
0 8 1 0 active sync /dev/sda1
1 8 17 1 active sync /dev/sdb1
/dev/sdb1
device as faulty:
~]# mdadm /dev/md3 --fail /dev/sdb1
mdadm: set /dev/sdb1 faulty in /dev/md3
~]# mdadm /dev/md3 --remove /dev/sdb1
mdadm: hot removed /dev/sdb1
~]# mdadm /dev/md3 --add /dev/sdb1
mdadm: added /dev/sdb1
root
:
mdadm
raid_device
--add
component_device
mdadm
--grow
raid_device
--raid-devices
=number
/dev/md3
, with the following layout (that is, the RAID device created in 예 5.2. “Creating a new RAID device”):
~]# mdadm --detail /dev/md3 | tail -n 3
Number Major Minor RaidDevice State
0 8 1 0 active sync /dev/sda1
1 8 17 1 active sync /dev/sdb1
/dev/sdc
, has been added and has exactly one partition. To add it to the /dev/md3
array, type the following at a shell prompt:
~]# mdadm /dev/md3 --add /dev/sdc1
mdadm: added /dev/sdc1
/dev/sdc1
as a spare device. To change the size of the array to actually use it, type:
~]# mdadm --grow /dev/md3 --raid-devices=3
root
:
mdadm
--stop
raid_device
mdadm
--remove
raid_device
mdadm
--zero-superblock
component_device
…
/dev/md3
, with the following layout (that is, the RAID device created in 예 5.4. “Extending a RAID device”):
~]# mdadm --detail /dev/md3 | tail -n 4
Number Major Minor RaidDevice State
0 8 1 0 active sync /dev/sda1
1 8 17 1 active sync /dev/sdb1
2 8 33 2 active sync /dev/sdc1
~]# mdadm --stop /dev/md3
mdadm: stopped /dev/md3
/dev/md3
device by running the following command:
~]# mdadm --remove /dev/md3
~]# mdadm --zero-superblock /dev/sda1 /dev/sdb1 /dev/sdc1
mdadm
command only apply to the current session, and will not survive a system restart. At boot time, the mdmonitor
service reads the content of the /etc/mdadm.conf
configuration file to see which RAID devices to start. If the software RAID was configured during the graphical installation process, this file contains directives listed in 표 5.1. “Common mdadm.conf directives” by default.
Option | Description |
---|---|
ARRAY
|
Allows you to identify a particular array.
|
DEVICE
|
Allows you to specify a list of devices to scan for a RAID component (for example, “/dev/hda1”). You can also use the keyword
partitions to use all partitions listed in /proc/partitions , or containers to specify an array container.
|
MAILADDR
| Allows you to specify an email address to use in case of an alert. |
ARRAY
lines are presently in use regardless of the configuration, run the following command as root
:
mdadm
--detail
--scan
/etc/mdadm.conf
file. You can also display the ARRAY
line for a particular device:
mdadm
--detail
--brief
raid_device
mdadm
--detail
--brief
raid_device
>>/etc/mdadm.conf
/etc/mdadm.conf
contains the software RAID configuration created during the system installation:
# mdadm.conf written out by anaconda DEVICE partitions MAILADDR root ARRAY /dev/md0 level=raid1 num-devices=2 UUID=49c5ac74:c2b79501:5c28cb9c:16a6dd9f ARRAY /dev/md1 level=raid0 num-devices=2 UUID=76914c11:5bfa2c00:dc6097d1:a1f4506d ARRAY /dev/md2 level=raid0 num-devices=2 UUID=2b5d38d0:aea898bf:92be20e2:f9d893c5
/dev/md3
device as shown in 예 5.2. “Creating a new RAID device”, you can make it persistent by running the following command:
~]# mdadm --detail --brief /dev/md3 >> /etc/mdadm.conf
mdadm
man page — A manual page for the mdadm
utility.
mdadm.conf
man page — A manual page that provides a comprehensive list of available /etc/mdadm.conf
configuration options.
Amount of RAM in the System | Recommended Amount of Swap Space |
---|---|
4GB of RAM or less | a minimum of 2GB of swap space |
4GB to 16GB of RAM | a minimum of 4GB of swap space |
16GB to 64GB of RAM | a minimum of 8GB of swap space |
64GB to 256GB of RAM | a minimum of 16GB of swap space |
256GB to 512GB of RAM | a minimum of 32GB of swap space |
free
and cat /proc/swaps
commands to verify how much and where swap is in use.
/dev/VolGroup00/LogVol01
is the volume you want to extend):
swapoff -v /dev/VolGroup00/LogVol01
lvm lvresize /dev/VolGroup00/LogVol01 -L +256M
mkswap /dev/VolGroup00/LogVol01
swapon -va
cat /proc/swaps
free
/dev/VolGroup00/LogVol02
is the swap volume you want to add):
lvm lvcreate VolGroup00 -n LogVol02 -L 256M
mkswap /dev/VolGroup00/LogVol02
/etc/fstab
file:
/dev/VolGroup00/LogVol02 swap swap defaults 0 0
swapon -va
cat /proc/swaps
free
count
being equal to the desired block size:
dd if=/dev/zero of=/swapfile bs=1024 count=65536
mkswap /swapfile
swapon /swapfile
/etc/fstab
to include the following entry:
/swapfile swap swap defaults 0 0
cat /proc/swaps
or free
.
/dev/VolGroup00/LogVol01
is the volume you want to reduce):
swapoff -v /dev/VolGroup00/LogVol01
lvm lvreduce /dev/VolGroup00/LogVol01 -L -512M
mkswap /dev/VolGroup00/LogVol01
swapon -va
cat /proc/swaps
free
/dev/VolGroup00/LogVol02
is the swap volume you want to remove):
swapoff -v /dev/VolGroup00/LogVol02
lvm lvremove /dev/VolGroup00/LogVol02
/etc/fstab
file:
/dev/VolGroup00/LogVol02 swap swap defaults 0 0
cat /proc/swaps
free
parted
parted
allows users to:
parted
package is included when installing Red Hat Enterprise Linux. To start parted
, log in as root and type the command parted /dev/sda
at a shell prompt (where /dev/sda
is the device name for the drive you want to configure).
umount
command and turn off all the swap space on the hard drive with the swapoff
command.
parted
commands” contains a list of commonly used parted
commands. The sections that follow explain some of these commands and arguments in more detail.
parted
commands명령어 | 설명 |
---|---|
check
| 파일 시스템에 대한 간단한 확인 작업을 수행합니다. |
cp
|
파일 시스템을 한 파티션에서 다른 파티션으로 복사합니다; from 과 to 는 파티션의 minor 번호를 의미합니다.
|
help
| 사용 가능한 명령어 목록을 보여줍니다. |
mklabel
| 파티션 테이블에 대한 디스크 레이블을 생성합니다. |
mkfs
|
file-system-type 유형의 파일 시스템을 생성합니다.
|
mkpart
| 새로운 파일 시스템을 생성하지 않고 파티션을 만듭니다. |
mkpartfs
| 파티션을 만들고 특정 파일 시스템을 생성합니다. |
move
| 파티션을 이동합니다. |
name
| Mac과 PC98 디스크레이블 용 파티션만 이름 지정합니다 |
print
| 파티션 테이블을 보여줍니다. |
quit
|
Quit parted
|
rescue start-mb end-mb
|
잃은 파티션의 크기를 start-mb 에서 end-mb 로 복구합니다.
|
resize
|
파티션의 크기를 start-mb 에서 end-mb 로 재조정합니다.
|
rm
| 파티션을 삭제합니다. |
select
| 설정할 다른 장치를 선택합니다. |
set
|
파티션 상에 플래그(flag)를 설정합니다; state 는 on(켜짐) 이나 off(꺼짐) 중 하나를 입력합니다.
|
toggle [
|
Toggle the state of FLAG on partition NUMBER
|
unit
|
Set the default unit to UNIT
|
parted
, use the command print
to view the partition table. A table similar to the following appears:
Model: ATA ST3160812AS (scsi) Disk /dev/sda: 160GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 32.3kB 107MB 107MB primary ext3 boot 2 107MB 105GB 105GB primary ext3 3 105GB 107GB 2147MB primary linux-swap 4 107GB 160GB 52.9GB extended root 5 107GB 133GB 26.2GB logical ext3 6 133GB 133GB 107MB logical ext3 7 133GB 160GB 26.6GB logical lvm
number
. For example, the partition with minor number 1 corresponds to /dev/sda1
. The Start
and End
values are in megabytes. Valid Type
are metadata, free, primary, extended, or logical. The Filesystem
is the file system type, which can be any of the following:
Filesystem
of a device shows no value, this means that its file system type is unknown.
parted
, where /dev/sda
is the device on which to create the partition:
parted /dev/sda
print
mkpart primary ext3 1024 2048
mkpartfs
command instead, the file system is created after the partition is created. However, parted
does not support creating an ext3 file system. Thus, if you wish to create an ext3 file system, use mkpart
and create the file system with the mkfs
command as described later.
print
command to confirm that it is in the partition table with the correct partition type, file system type, and size. Also remember the minor number of the new partition so that you can label it. You should also view the output of
cat /proc/partitions
mkfs -t ext3 /dev/sda6
/dev/sda6
and you want to label it /work
:
e2label /dev/sda6 /work
mkdir /work
/etc/fstab
/etc/fstab
file to include the new partition. The new line should look similar to the following:
LABEL=/work /work ext3 defaults 1 2
LABEL=
followed by the label you gave the partition. The second column should contain the mount point for the new partition, and the next column should be the file system type (for example, ext3 or swap). If you need more information about the format, read the man page with the command man fstab
.
defaults
, the partition is mounted at boot time. To mount the partition without rebooting, as root, type the command:
mount /work
parted
, where /dev/sda
is the device on which to remove the partition:
parted /dev/sda
print
rm
. For example, to remove the partition with minor number 3:
rm 3
print
command to confirm that it is removed from the partition table. You should also view the output of
cat /proc/partitions
/etc/fstab
file. Find the line that declares the removed partition, and remove it from the file.
parted
, where /dev/sda
is the device on which to resize the partition:
parted /dev/sda
print
resize
command followed by the minor number for the partition, the starting place in megabytes, and the end place in megabytes. For example:
resize 3 1024 2048
print
command to confirm that the partition has been resized correctly, is the correct partition type, and is the correct file system type.
df
to make sure the partition was mounted and is recognized with the new size.
lvm help
at a command prompt.
LVM
commands명령어 | 설명 |
---|---|
dumpconfig
| Dump the active configuration |
formats
| List the available metadata formats |
help
| Display the help commands |
lvchange
| Change the attributes of logical volume(s) |
lvcreate
| Create a logical volume |
lvdisplay
| Display information about a logical volume |
lvextend
| Add space to a logical volume |
lvmchange
| Due to use of the device mapper, this command has been deprecated |
lvmdiskscan
| List devices that may be used as physical volumes |
lvmsadc
| Collect activity data |
lvmsar
| Create activity report |
lvreduce
| Reduce the size of a logical volume |
lvremove
| Remove logical volume(s) from the system |
lvrename
| Rename a logical volume |
lvresize
| Resize a logical volume |
lvs
| Display information about logical volumes |
lvscan
| List all logical volumes in all volume groups |
pvchange
| Change attributes of physical volume(s) |
pvcreate
| Initialize physical volume(s) for use by LVM |
pvdata
| Display the on-disk metadata for physical volume(s) |
pvdisplay
| Display various attributes of physical volume(s) |
pvmove
| Move extents from one physical volume to another |
pvremove
| Remove LVM label(s) from physical volume(s) |
pvresize
| Resize a physical volume in use by a volume group |
pvs
| Display information about physical volumes |
pvscan
| List all physical volumes |
segtypes
| List available segment types |
vgcfgbackup
| Backup volume group configuration |
vgcfgrestore
| Restore volume group configuration |
vgchange
| Change volume group attributes |
vgck
| Check the consistency of a volume group |
vgconvert
| Change volume group metadata format |
vgcreate
| Create a volume group |
vgdisplay
| Display volume group information |
vgexport
| Unregister a volume group from the system |
vgextend
| Add physical volumes to a volume group |
vgimport
| Register exported volume group with system |
vgmerge
| Merge volume groups |
vgmknodes
| Create the special files for volume group devices in /dev/ |
vgreduce
| Remove a physical volume from a volume group |
vgremove
| Remove a volume group |
vgrename
| Rename a volume group |
vgs
| Display information about volume groups |
vgscan
| Search for all volume groups |
vgsplit
| Move physical volumes into a new volume group |
version
| Display software and driver version information |
quota
RPM must be installed to implement disk quotas. /etc/fstab
file.
/etc/fstab
file. Add the usrquota
and/or grpquota
options to the file systems that require quotas:
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1 LABEL=/boot /boot ext3 defaults 1 2 none /dev/pts devpts gid=5,mode=620 0 0 none /dev/shm tmpfs defaults 0 0 none /proc proc defaults 0 0 none /sys sysfs defaults 0 0 /dev/VolGroup00/LogVol02 /home ext3 defaults,usrquota,grpquota 1 2 /dev/VolGroup00/LogVol01 swap swap defaults 0 0 . . .
/home
file system has both user and group quotas enabled.
/home
partition was created during the installation of Red Hat Enterprise Linux. The root (/
) partition can be used for setting quota policies in the /etc/fstab
file.
usrquota
and/or grpquota
options, remount each file system whose fstab
entry has been modified. If the file system is not in use by any process, use one of the following methods:
umount
command followed by the mount
command to remount the file system.(See the man
page for both umount
and mount
for the specific syntax for mounting and unmounting various filesystem types.)
mount -o remount <file-system>
command (where <file-system>
is the name of the file system) to remount the file system. For example, to remount the /home
file system, the command to issue is mount -o remount /home
.
quotacheck
command.
quotacheck
command examines quota-enabled file systems and builds a table of the current disk usage per file system. The table is then used to update the operating system's copy of disk usage. In addition, the file system's disk quota files are updated.
aquota.user
and aquota.group
) on the file system, use the -c
option of the quotacheck
command. For example, if user and group quotas are enabled for the /home
file system, create the files in the /home
directory:
quotacheck -cug /home
-c
option specifies that the quota files should be created for each file system with quotas enabled, the -u
option specifies to check for user quotas, and the -g
option specifies to check for group quotas.
-u
옵션과 -g
옵션이 지정되지 않았다면, 사용자 사용량 할당 파일만 생성됩니다. -g
옵션만 지정된 경우에는, 그룹 사용량 할당 파일만 만들어 집니다.
quotacheck -avug
a
— 디스크 사용량 할당이 활성화되고, 로컬에서 마운트된 모든 파일 시스템을 확인합니다.
v
— 사용량 할당 확인 작업이 진행 과정을 상세한 상태 정보로 보여줍니다.
u
— 사용자 디스크 사용량 할당 정보를 체크합니다.
g
— 그룹 디스크 사용량 할당 정보를 체크합니다.
quotacheck
has finished running, the quota files corresponding to the enabled quotas (user and/or group) are populated with data for each quota-enabled locally-mounted file system such as /home
.
edquota
command.
edquota username
/etc/fstab
for the /home
partition (/dev/VolGroup00/LogVol02
in the example below) and the command edquota testuser
is executed, the following is shown in the editor configured as the default for the system:
Disk quotas for user testuser (uid 501): Filesystem blocks soft hard inodes soft hard /dev/VolGroup00/LogVol02 440436 0 0 37418 0 0
EDITOR
environment variable is used by edquota
. To change the editor, set the EDITOR
environment variable in your ~/.bash_profile
file to the full path of the editor of your choice.
inodes
column shows how many inodes the user is currently using. The last two columns are used to set the soft and hard inode limits for the user on the file system.
Disk quotas for user testuser (uid 501): Filesystem blocks soft hard inodes soft hard /dev/VolGroup00/LogVol02 440436 500000 550000 37418 0 0
quota testuser
devel
group (the group must exist prior to setting the group quota), use the command:
edquota -g devel
Disk quotas for group devel (gid 505): Filesystem blocks soft hard inodes soft hard /dev/VolGroup00/LogVol02 440400 0 0 37418 0 0
quota -g devel
edquota -t
edquota
commands operate on a particular user's or group's quota, the -t
option operates on every filesystem with quotas enabled.
quotaoff -vaug
-u
or -g
options are specified, only the user quotas are disabled. If only -g
is specified, only group quotas are disabled. The -v
switch causes verbose status information to display as the command executes.
quotaon
command with the same options.
quotaon -vaug
/home
, use the following command:
quotaon -vug /home
-u
옵션이나 -g
옵션이 지정되지 않는다면, 사용자 디스크 사용량 할당만이 활성화 됩니다. -g
옵션만 지정된 경우에는 그룹 디스크 사용량 할당만이 활성화 됩니다.
repquota
utility. For example, the command repquota /home
produces this output:
*** Report for user quotas on device /dev/mapper/VolGroup00-LogVol02 Block grace time: 7days; Inode grace time: 7days Block limits File limits User used soft hard grace used soft hard grace ---------------------------------------------------------------------- root -- 36 0 0 4 0 0 kristin -- 540 0 0 125 0 0 testuser -- 440400 500000 550000 37418 0 0
-a
) quota-enabled file systems, use the command:
repquota -a
--
displayed after each user is a quick way to determine whether the block or inode limits have been exceeded. If either soft limit is exceeded, a +
appears in place of the corresponding -
; the first -
represents the block limit, and the second represents the inode limit.
grace
columns are normally blank. If a soft limit has been exceeded, the column contains a time specification equal to the amount of time remaining on the grace period. If the grace period has expired, none
appears in its place.
quotacheck
include:
/etc/cron.daily/
or /etc/cron.weekly/
directory—or schedule one using the crontab -e
command—that contains the touch /forcequotacheck
command. This creates an empty forcequotacheck
file in the root directory, which the system init script looks for at boot time. If it is found, the init script runs quotacheck
. Afterward, the init script removes the /forcequotacheck
file; thus, scheduling this file to be created periodically with cron
ensures that quotacheck
is run during the next reboot.
cron
.
quotacheck
is to (re-)boot the system into single-user mode to prevent the possibility of data corruption in quota files and run:
~]# quotaoff -vaug /<file_system>
~]# quotacheck -vaug /<file_system>
~]# quotaon -vaug /<file_system>
quotacheck
on a machine during a time when no users are logged in, and thus have no open files on the file system being checked. Run the command quotacheck -vaug <file_system>
; this command will fail if quotacheck
cannot remount the given <file_system>
as read-only. Note that, following the check, the file system will be remounted read-write.
quotacheck
on a live file system mounted read-write is not recommended due to the possibility of quota file corruption.
cron
.
acl
package is required to implement ACLs. It contains the utilities used to add, modify, remove, and retrieve ACL information.
cp
and mv
commands copy or move any ACLs associated with files and directories.
mount -t ext3 -o acl <device-name>
<partition>
mount -t ext3 -o acl /dev/VolGroup00/LogVol02 /work
/etc/fstab
file, the entry for the partition can include the acl
option:
LABEL=/work /work ext3 acl 1 2
--with-acl-support
옵션을 사용하여 컴파일되었기 때문에 ACL을 사용 가능합니다. Samba 공유를 사용하거나 마운팅할시 특별한 플래그(flag)를 사용할 필요가 없습니다.
no_acl
option in the /etc/exports
file. To disable ACLs on an NFS share when mounting it on a client, mount it with the no_acl
option via the command line or the /etc/fstab
file.
setfacl
utility sets ACLs for files and directories. Use the -m
option to add or modify the ACL of a file or directory:
setfacl -m <rules>
<files>
<rules>
) must be specified in the following formats. Multiple rules can be specified in the same command if they are separated by commas.
u:<uid>
:<perms>
g:<gid>
:<perms>
m:<perms>
o:<perms>
<perms>
) must be a combination of the characters r
, w
, and x
for read, write, and execute.
setfacl
command is used, the additional rules are added to the existing ACL or the existing rule is modified.
setfacl -m u:andrius:rw /project/somefile
-x
option and do not specify any permissions:
setfacl -x <rules>
<files>
setfacl -x u:500 /project/somefile
d:
before the rule and specify a directory instead of a file name.
/share/
directory to read and execute for users not in the user group (an access ACL for an individual file can override it):
setfacl -m d:o:rx /share
getfacl
command. In the example below, the getfacl
is used to determine the existing ACLs for a file.
getfacl home/john/picture.png
# file: home/john/picture.png # owner: john # group: john user::rw- group::r-- other::r--
[john@main /]$ getfacl home/sales/
# file: home/sales/
# owner: john
# group: john
user::rw-
user:barryg:r--
group::r--
mask::r--
other::r--
default:user::rwx
default:user:john:rwx
default:group::r-x
default:mask::rwx
default:other::r-x
tar
and dump
commands do not backup ACLs.
star
utility is similar to the tar
utility in that it can be used to generate archives of files; however, some of its options are different. Refer to 표 9.1. “Command Line Options for star
” for a listing of more commonly used options. For all available options, refer to the star
man page. The star
package is required to use this utility.
star
옵션 | 설명 |
---|---|
-c
| 아카이브 파일을 생성합니다. |
-n
|
파일을 압축 해제하지 않습니다; -x 옵션과 함께 사용하여 파일을 압축 해제할 수 있습니다.
|
-r
| 아카이브에서 파일을 대체합니다. 파일들은 동일한 경로와 파일명을 가진 파일들을 대체하여 아카이브 파일 마지막에 기록됩니다. |
-t
| 아카이브 파일의 내용을 보여줍니다. |
-u
| 아카이브 파일을 업데이트합니다. 파일들이 아카이브에 존재하지 아허나 파일들이 아카이브에 있는 동일한 이름의 파일 보다 최신의 것을 경우, 아카이브 마지막에 기록됩니다. 이 옵션은 아카이브가 파일이거나 특별 테이프 (블록 크기가 정해지지 않은 테이프)인 경우에만 작동합니다. |
-x
|
아카이브에서 파일을 압축 해제합니다. -U 옵션과 함께 사용되면 파일 시스템에 존재하는 상응하는 파일 보다 아카이브에 저장된 파일이 이전 것일 경우, 그 파일은 압축 해제되지 않습니다.
|
-help
| 대부분의 중요한 옵션을 보여줍니다. |
-xhelp
| 자주 사용되지 않는 옵션들을 보여줍니다. |
-/
| 아카이브에서 파일을 압축 해제할 때 파일명 앞에 위치한 슬래쉬를 제거하지 마십시오. 기본 값으로, 파일이 압축 해제될 때 슬래쉬가 제거됩니다. |
-acl
| 파일과 디렉토리와 연관된 ACL을 생성, 압축 해제, 압축하거나 복구할 때 사용됩니다. |
ext_attr
attribute. This attribute can be seen using the following command:
tune2fs -l <filesystem-device>
ext_attr
attribute can be mounted with older kernels, but those kernels do not enforce any ACLs which have been set.
e2fsck
utility included in version 1.22 and higher of the e2fsprogs
package (including the versions in Red Hat Enterprise Linux 2.1 and 4) can check a file system with the ext_attr
attribute. Older versions refuse to check it.
acl
man page — Description of ACLs
getfacl
man page — Discusses how to get file access control lists
setfacl
man page — Explains how to set file access control lists
star
man page — Explains more about the star
utility and its many options
/boot
partition. The /boot
partition cannot be on a logical volume group because the boot loader cannot read it. If the root (/
) partition is on a logical volume, create a separate /boot
partition which is not a part of a volume group.
/home
and /
and file system types, such as ext2 or ext3. When "partitions" reach their full capacity, free space from the volume group can be added to the logical volume to increase the size of the partition. When a new hard drive is added to the system, it can be added to the volume group, and partitions that are logical volumes can be increased in size.
system-config-lvm
utility to create your own LVM configuration post-installation. The next two sections focus on using Disk Druid during installation to complete this task. The third section introduces the LVM utility (system-config-lvm
) which allows you to manage your LVM volumes in X windows or graphically.
/dev/sda
and /dev/sdb
) are used in the following examples. They detail how to create a simple configuration using a single LVM volume group with associated logical volumes during installation.
/boot
partition resides on its own non-LVM partition. In the following example, it is the first partition on the first drive (/dev/sda1
). Bootable partitions cannot reside on LVM logical volumes.
VolGroup00
) is created, which spans all selected drives and all remaining space available. In the following example, the remainder of the first drive (/dev/sda2
), and the entire second drive (/dev/sdb1
) are allocated to the volume group.
LogVol00
and LogVol01
) are created from the newly created spanned volume group. In the following example, the recommended swap space is automatically calculated and assigned to LogVol01
, and the remainder is allocated to the root file system, LogVol00
.
/home
or /var
, so that each file system has its own independent quota configuration limits.
/boot
Partition/boot
partition cannot reside on an LVM volume because the GRUB boot loader cannot read it.
/boot
Partition Displayed
/boot
Partition Displayed/
, /home
, and swap space. Remember that /boot
cannot be a logical volume. To add a logical volume, click the button in the Logical Volumes section. A dialog window as shown in 그림 10.10. “Creating a Logical Volume” appears.
system-config-lvm
system-config-lvm
from a terminal.
/boot - (Ext3) file system. Displayed under 'Uninitialized Entities'. (DO NOT initialize this partition). LogVol00 - (LVM) contains the (/) directory (312 extents). LogVol02 - (LVM) contains the (/home) directory (128 extents). LogVol03 - (LVM) swap (28 extents).
/dev/hda2
while /boot
was created in /dev/hda1
. The system also consists of 'Uninitialized Entities' which are illustrated in 그림 10.17. “Uninitialized Entities”. The figure below illustrates the main window in the LVM utility. The logical and the physical views of the above configuration are illustrated below. The three logical volumes exist on the same physical volume (hda2).
/
(root) directory, this task will not be successful as the volume cannot be unmounted.
/boot
. Uninitialized entities are illustrated below.
/dev/hda6
was selected as illustrated below.
/mnt/backups
. This is illustrated in the figure below.
rpm -qd lvm2
— This command shows all the documentation available from the lvm
package, including man pages.
lvm help
— This command shows all LVM commands available.
차례
rpm
package. For the end user, RPM makes system updates easy. Installing, uninstalling, and upgrading RPM packages can be accomplished with short commands. RPM maintains a database of installed packages and their files, so you can invoke powerful queries and verifications on your system. If you prefer a graphical interface, you can use the Package Management Tool to perform many RPM commands. Refer to 12장. Package Management Tool for details.
.tar.gz
files.
rpm --help
or man rpm
. You can also refer to 11.5절. “추가 자료” for more information on RPM.
foo-1.0-1.i386.rpm
. The file name includes the package name (foo
), version (1.0
), release (1
), and architecture (i386
). To install a package, log in as root and type the following command at a shell prompt:
rpm -ivh foo-1.0-1.i386.rpm
rpm -Uvh foo-1.0-1.i386.rpm
Preparing... ########################################### [100%] 1:foo ########################################### [100%]
error: V3 DSA signature: BAD, key ID 0352860f
error: Header V3 DSA signature: BAD, key ID 0352860f
NOKEY
such as:
warning: V3 DSA signature: NOKEY, key ID 0352860f
rpm -ivh
instead. Refer to 42장. Manually Upgrading the Kernel for details.
Preparing... ########################################### [100%] package foo-1.0-1 is already installed
--replacepkgs
option, which tells RPM to ignore the error:
rpm -ivh --replacepkgs foo-1.0-1.i386.rpm
Preparing... ########################################### [100%] file /usr/bin/foo from install of foo-1.0-1 conflicts with file from package bar-2.0.20
--replacefiles
option:
rpm -ivh --replacefiles foo-1.0-1.i386.rpm
error: Failed dependencies: bar.so.2 is needed by foo-1.0-1 Suggested resolutions: bar-2.0.20-3.i386.rpm
rpm -ivh foo-1.0-1.i386.rpm bar-2.0.20-3.i386.rpm
Preparing... ########################################### [100%] 1:foo ########################################### [ 50%] 2:bar ########################################### [100%]
-q --whatprovides
option combination to determine which package contains the required file.
rpm -q --whatprovides bar.so.2
--nodeps
옵션을 사용하시기 바랍니다. (제대로 실행되지 않는 문제가 발생할 수도 있으므로 권장하지 않습니다.)
rpm -e foo
foo
, not the name of the original package file foo-1.0-1.i386.rpm
. To uninstall a package, replace foo
with the actual package name of the original package.
error: Failed dependencies: foo is needed by (installed) bar-2.0.20-3.i386.rpm
--nodeps
옵션을 사용하시면 됩니다. 하지만, 이 옵션을 사용하시면 패키지가 제대로 실행되지 않을 가능성이 있습니다.
rpm -Uvh foo-2.0-1.i386.rpm
foo
package. Note that -U
will also install a package even when there are no previous versions of the package installed.
-U
옵션은 이전 패키지를 교체하기 때문에 커널 패키지를 설치할 때는 -U
옵션을 사용하지 않는 것이 좋습니다. 실행 중인 시스템에 영향을 주진 않지만, 시스템을 재시작할 때 새로운 커널을 사용할 수 없으면 대체할 다른 커널이 없으므로 -U
옵션 사용을 지양합니다.
-i
option adds the kernel to your GRUB boot menu (/etc/grub.conf
). Similarly, removing an old, unneeded kernel removes the kernel from GRUB.
saving /etc/foo.conf as /etc/foo.conf.rpmsave
package foo-2.0-1 (which is newer than foo-1.0-1) is already installed
--oldpackage
option:
rpm -Uvh --oldpackage foo-1.0-1.i386.rpm
rpm -Fvh foo-1.2-1.i386.rpm
rpm -Fvh *.rpm
/var/lib/rpm/
디렉토리에 저장되며 어느 패키지가 설치되고, 각 패키지 버전이 무엇이며, 설치 후에 패키지의 어느 파일에 어떤 수정 사항이 있었는지에 대한 정보를 찾는 데 사용됩니다.
-q
option. The rpm -q package name
command displays the package name, version, and release number of the installed package package name
. For example, using rpm -q foo
to query installed package foo
might generate the following output:
foo-2.0-1
-q
to further refine or qualify your query:
-a
— queries all currently installed packages.
-f <filename>
— queries the RPM database for which package owns f<filename>
. When specifying a file, specify the absolute path of the file (for example, rpm -qf /bin/ls
).
-p <packagefile>
— queries the uninstalled package <packagefile>
.
-i
displays package information including name, description, release, size, build date, install date, vendor, and other miscellaneous information.
-l
displays the list of files that the package contains.
-s
displays the state of all the files in the package.
-d
displays a list of files marked as documentation (man pages, info pages, READMEs, etc.).
-c
displays a list of files marked as configuration files. These are the files you edit after installation to adapt and customize the package to your system (for example, sendmail.cf
, passwd
, inittab
, etc.).
-v
to the command to display the lists in a familiar ls -l
format.
rpm -V
verifies a package. You can use any of the Verify Options listed for querying to specify the packages you wish to verify. A simple use of verifying is rpm -V foo
, which verifies that all the files in the foo
package are as they were when they were originally installed. For example:
rpm -Vf /usr/bin/foo
/usr/bin/foo
는 패키지 질의에 사용되는 파일에 대한 절대 경로입니다.
rpm -Va
rpm -Vp foo-1.0-1.i386.rpm
c
denotes a configuration file) and then the file name. Each of the eight characters denotes the result of a comparison of one attribute of the file to the value of that attribute recorded in the RPM database. A single period (.
) means the test passed. The following characters denote specific discrepancies:
5
— MD5 checksum
S
— file size
L
— symbolic link
T
— file modification time
D
— device
U
— user
G
— group
M
— mode (includes permissions and file type)
?
— unreadable file
<rpm-file>
is the file name of the RPM package):
rpm -K --nosignature <rpm-file>
<rpm-file>
: md5 OK
is displayed. This brief message means that the file was not corrupted by the download. To see a more verbose message, replace -K
with -Kvv
in the command.
x
파일을 해독하고 검증할 수 있습니다.
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
rpm -qa gpg-pubkey*
gpg-pubkey-37017186-45761324
rpm -qi
followed by the output from the previous command:
rpm -qi gpg-pubkey-37017186-45761324
<rpm-file>
with the filename of the RPM package):
rpm -K <rpm-file>
md5 gpg OK
. This means that the signature of the package has been verified, and that it is not corrupt.
rpm -Va
rpm -qf /usr/bin/ggv
ggv-2.6.0-2
/usr/bin/paste
. You would like to verify the package that owns that program, but you do not know which package owns paste
. Enter the following command,
rpm -Vf /usr/bin/paste
rpm -qdf /usr/bin/free
/usr/share/doc/procps-3.2.3/BUGS /usr/share/doc/procps-3.2.3/FAQ /usr/share/doc/procps-3.2.3/NEWS /usr/share/doc/procps-3.2.3/TODO /usr/share/man/man1/free.1.gz /usr/share/man/man1/pgrep.1.gz /usr/share/man/man1/pkill.1.gz /usr/share/man/man1/pmap.1.gz /usr/share/man/man1/ps.1.gz /usr/share/man/man1/skill.1.gz /usr/share/man/man1/slabtop.1.gz /usr/share/man/man1/snice.1.gz /usr/share/man/man1/tload.1.gz /usr/share/man/man1/top.1.gz /usr/share/man/man1/uptime.1.gz /usr/share/man/man1/w.1.gz /usr/share/man/man1/watch.1.gz /usr/share/man/man5/sysctl.conf.5.gz /usr/share/man/man8/sysctl.8.gz /usr/share/man/man8/vmstat.8.gz
rpm -qip crontabs-1.10-7.noarch.rpm
Name : crontabs Relocations: (not relocatable) Version : 1.10 Vendor: Red Hat, Inc. Release : 7 Build Date: Mon 20 Sep 2004 05:58:10 PM EDT Install Date: (not installed) Build Host: tweety.build.redhat.com Group : System Environment/Base Source RPM: crontabs-1.10-7.src.rpm Size : 1004 License: Public Domain Signature : DSA/SHA1, Wed 05 Jan 2005 06:05:25 PM EST, Key ID 219180cddb42a60e Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla> Summary : Root crontab files used to schedule the execution of programs. Description : The crontabs package contains root crontab files. Crontab is the program used to install, uninstall, or list the tables used to drive the cron daemon. The cron daemon checks the crontab files to see when particular commands are scheduled to be executed. If commands are scheduled, then it executes them.
crontabs
RPM installs. You would enter the following:
rpm -qlp crontabs-1.10-5.noarch.rpm
/etc/cron.daily /etc/cron.hourly /etc/cron.monthly /etc/cron.weekly /etc/crontab /usr/bin/run-parts
rpm --help
— This command displays a quick reference of RPM parameters.
man rpm
— The RPM man page gives more detail about RPM parameters than the rpm --help
command.
rpm
command does.
rpm -e --nodeps
or rpm -U --nodeps
can.
system-config-packages
or pirut
at shell prompt.
yum
searches numerous repositories for packages and their dependencies so they may be installed together in an effort to alleviate dependency issues. Red Hat Enterprise Linux 5.8 uses yum
to fetch packages and install RPMs.
up2date
is now deprecated in favor of yum
(Yellowdog Updater Modified). The entire stack of tools which installs and updates software in Red Hat Enterprise Linux 5.8 is now based on yum
. This includes everything, from the initial installation via Anaconda to host software management tools like pirut
.
yum
also allows system administrators to configure a local (i.e. available over a local network) repository to supplement packages provided by Red Hat. This is useful for user groups that use applications and packages that are not officially supported by Red Hat.
yum
repository also saves bandwidth for the entire network. Further, clients that use local yum
repositories do not need to be registered individually to install or update the latest packages from Red Hat Network.
createrepo
package:
~]# yum install createrepo
/mnt/local_repo
for example).
createrepo
on that directory (for example, createrepo /mnt/local_repo
). This will create the necessary metadata for your Yum repository.
yum
Commandsyum
commands are typically run as yum <command> <package name/s>
. By default, yum
will automatically attempt to check all configured repositories to resolve all package dependencies during an installation/upgrade.
yum
commands. For a complete list of available yum
commands, refer to man yum
.
yum install <package name/s>
yum update <package name/s>
yum
will attempt to update all installed packages.
--obsoletes
option is used (i.e. yum --obsoletes <package name/s>
, yum
will process obsolete packages. As such, packages that are obsoleted across updates will be removed and replaced accordingly.
yum check-update
yum
returns a list of all package updates from all repositories if any are available.
yum remove <package name/s>
yum provides <file name>
yum search <keyword>
yum localinstall <absolute path to package name/s>
yum
to install a package located locally in the machine.
yum
Optionsyum
options are typically stated before specific yum
commands; i.e. yum <options> <command> <package name/s>
. Most of these options can be set as default using the configuration file.
yum
options. For a complete list of available yum
options, refer to man yum
.
-y
-t
yum
to be "tolerant" of errors with regard to packages specified in the transaction. For example, if you run yum update package1 package2
and package2
is already installed, yum
will continue to install package1
.
--exclude=<package name>
yum
yum
is configured through /etc/yum.conf
. The following is an example of a typical /etc/yum.conf
file:
[main] cachedir=/var/cache/yum keepcache=0 debuglevel=2 logfile=/var/log/yum.log distroverpkg=redhat-release tolerant=1 exactarch=1 obsoletes=1 gpgcheck=1 plugins=1 metadata_expire=1800 [myrepo] name=RHEL 5 $releasever - $basearch baseurl=http://local/path/to/yum/repository/ enabled=1
/etc/yum.conf
file is made up of two types of sections: a [main]
section, and a repository section. There can only be one [main]
section, but you can specify multiple repositories in a single /etc/yum.conf
.
[main]
Options[main]
section is mandatory, and there must only be one. For a complete list of options you can use in the [main]
section, refer to man yum.conf
.
[main]
section.
cachedir
yum
should store its cache and database files. By default, the cache directory of yum
is /var/cache/yum
.
keepcache=<1 or 0>
keepcache=1
instructs yum
to keep the cache of headers and packages after a successful installation. keepcache=1
is the default.
reposdir=<absolute path to directory of .repo files>
.repo
files are located. .repo
files contain repository information (similar to the [repository
]
section of /etc/yum.conf
).
yum
collects all repository information from .repo
files and the [repository
]
section of the /etc/yum.conf
file to create a master list of repositories to use for each transaction. Refer to 13.4.2절. “ [repository
]
Options” for more information about options you can use for both the [repository
]
section and .repo
files.
reposdir
is not set, yum
uses the default directory /etc/yum.repos.d
.
gpgcheck=<1 or 0>
gpgcheck=0
, which disables GPG checking.
[main]
section of the /etc/yum.conf
file, it sets the GPG checking rule for all repositories. However, you can also set this on individual repositories instead; i.e., you can enable GPG checking on one repository while disabling it on another.
assumeyes=<1 or 0>
yum
should prompt for confirmation of critical actions. The default if assumeyes=0
, which means yum
will prompt you for confirmation.
assumeyes=1
is set, yum
behaves in the same way that the command line option -y
does.
tolerant=<1 or 0>
tolerant=1
), yum
will be tolerant of errors on the command line with regard to packages. This is similar to the yum
command line option -t
.
tolerant=0
(not tolerant).
exclude=<package name/s>
retries=<number of retries>
yum
should attempt to retrieve a file before returning an error. Setting this to 0 makes yum
retry forever. The default value is 6.
[repository
]
Options[repository
]
section of the /etc/yum.conf
file contains information about a repository yum
can use to find packages during package installation, updating and dependency resolution. A repository entry takes the following form:
[repository ID
] name=repository name
baseurl=url, file or ftp
://path to repository
.repo
files (for example, rhel5.repo
). The format of repository information placed in .repo
files is identical with the [repository
]
of /etc/yum.conf
.
.repo
files are typically placed in /etc/yum.repos.d
, unless you specify a different repository path in the [main]
section of /etc/yum.conf
with reposdir=
. .repo
files and the /etc/yum.conf
file can contain multiple repository entries.
repository ID
]name=repository name
baseurl=http, file or ftp
://path
repodata
directory of a repository is located. If the repository is local to the machine, use baseurl=file://path to local repository
. If the repository is located online using HTTP, use baseurl=http://link
. If the repository is online and uses FTP, use baseurl=ftp://link
.
baseurl
line by prepending it as username
:password
@link
. For example, if a repository on http://www.example.com/repo/ requires a username of "user" and a password os "password", then the baseurl
link can be specified as baseurl=http://user:password@www.example.com/repo/
.
man yum.conf
.
gpgcheck=<1 or 0>
gpgcheck=0
, which disables GPG checking.
gpgkey=URL
yum
needs a public key to verify a package and the required key was not imported into the RPM database.
yum
will automatically import the key from the specified URL. You will be prompted before the key is installed unless you set assumeyes=1
(in the [main]
section of /etc/yum.conf
) or -y
(in a yum
transaction).
exclude=<package name/s>
exclude
option in the [main]
section of /etc/yum.conf
. However, it only applies to the repository in which it is specified.
includepkgs=<package name/s>
exclude
. When this option is set on a repository, yum
will only be able to see the specified packages in that repository. By default, all packages in a repository are visible to yum
.
yum
Variablesyum
commands and yum
configuration files (i.e. /etc/yum.conf
and .repo
files).
$releasever
distroverpkg
. This defaults to the version of the redhat-release
package.
$arch
os.uname()
in Python.
$basearch
$arch
=i686 then $basearch
=i386.
$YUM0-9
yum
to unit content delivery with subscription management. The Subscription Manager handles only the subscription-system associations. yum
or other package management tools handle the actual content delivery. 13장. YUM (Yellowdog Updater Modified) describes how to use yum
.
yum
plug-ins that come with the Subscription Manager tools.
root
because of the nature of the changes to the system. However, Red Hat Subscription Manager connects to the subscription service as a user account for the Customer Service Portal.
firstboot
process for configuring content and updates, but the system can be registered at any time through the Red Hat Subscription Manager GUI or CLI. New subscriptions, new products, and updates can be viewed and applied to a system through the Red Hat Subscription Manager tools.
yum
service through the Red Hat Subscription Manager yum plug-in.
yum
.
root
.
[root@server1 ~]# subscription-manager-gui
subscription-manager
tool. This tools has the following format:
[root@server1 ~]# subscription-manager command [options]
subscription-manager
help and manpage have more information.
Command | Description |
---|---|
register | Registers or identifies a new system to the subscription service. |
unregister | Unregisters a machine, which strips its subscriptions and removes the machine from the subscription service. |
subscribe | Allocates a specific subscription to the machine. |
redeem | Autosubscribes a machine to a pre-specified subscription that was purchased from a vendor, based on its hardware and BIOS information. |
refresh |
Pulls the latest entitlement data from the server. Normally, the system polls the entitlement server at a set interval (4 hours by default) to check for any changes in the available subscriptions. The refresh command checks with the entitlement server right then, outside the normal interval.
|
unsubscribe | Removes a specific subscription or all subscriptions from the machine. |
list | Lists all of the subscriptions that are compatible with a machine, either subscriptions that are actually consumed by the machine or unused subscriptions that are available to the machine. |
identity | Handles the identity certificate and registration ID for a system. This command can be used to return the current UUID or generate a new identity certificate. |
facts | Lists the system information, like the release version, number of CPUs, and other architecture information. |
clean |
Removes all of the subscription and identity data from the local system, without affecting the consumer information in the subscription service. Any of the subscriptions consumed by the system are still consumed and are not available for other systems to use. The clean command is useful in cases where the local entitlement information is corrupted or lost somehow, and the system will be reregistered using the register --consumerid=EXISTING_ID command.
|
orgs, repos, environments | Lists all of the configured organizations, environments, and content repositories that are available to the given user account or system. These commands are used to view information in a multi-org infrastructure. They are not used to configure the local machine or multi-org infrastructure. |
libvirt-rhsm
, checks VMWare, KVM, and Xen processes and then relays that information to Subscription Manager and any configured subscription service (Certificate-based Red Hat Network or a local Subscription Asset Manager). Each guest machine on a host is assigned a guest ID, and that guest ID is both associated with the host and used to generate the identity certificate for the guest when it is registered.
system
type of consumer.
system
, meaning that each individual server subscribes to its own entitlements for its own use. There is another type of consumer, though, which is available for server groups, the domain
type. domain
-based entitlements are not allocated to a single system; they are distributed across the group of servers to govern the behavior of that group of servers. (That server group is called a domain.)
system
consumer and added to the inventory individually.
domain
entitlements apply to the behavior of the entire server group, not to any one system.
domain
entitlements using the Red Hat Subscription Manager tools, and the entitlement certificate is replicated between the domain servers.
subscription-manager-gui
rhsm.conf
configuration file points to the local subscription service (in the hostname
parameter) and the local content server (in the baseurl
parameter). The Subscription Manager configuration is described in 14.14절. “Configuring the Subscription Service”.
subscription-manager-gui
.zip
file. Save the file to some kind of portable media, like a flash drive.
certificates.zip
file. Unzip the directories until the PEM files for the entitlement certificates are available.
import
command. For example:
# subscription-manager import --certificate=/tmp/export/entitlement_certificates/596576341785244687.pem --certificate=/tmp/export/entitlement_certificates/3195996649750311162.pem Successfully imported certificate 596576341785244687.pem Successfully imported certificate 3195996649750311162.pem
cert.pem
file directly into the /etc/pki/consumer
directory. For example:
cp /tmp/downloads/cert.pem /etc/pki/consumer
register
command with the user account information required to authenticate to the Certificate-Based Red Hat Network (the credentials used to access subscription service or the Customer Portal). When the system is successfully authenticated, it echoes back the newly-assigned consumer ID and the user account name which registered it.
register
options are listed in 표 14.2. “register Options”.
[root@server1 ~]# subscription-manager register --username admin-example --password secret
7d133d55-876f-4f47-83eb-0ee931cb0a97 admin-example (the new consumer UUID and the account used for registration)
--org
option in addition to the username and password. The given user must also have the access permissions to add systems to that organization. (See 14.12절. “Working with Subscription Asset Manager” for information about organizations and Subscription Asset Manager.)
[root@server1 ~]# subscription-manager register --username admin-example --password secret--org="IT Department"
7d133d55-876f-4f47-83eb-0ee931cb0a97 admin-example(the new consumer UUID and the account used for registration)
[root@server1 ~]# subscription-manager register --username admin-example --password secret --org="IT Department" --environment=Dev1,ITall
register
command returns a Remote Server error.
register
command has an option, --autosubscribe
, which allows the system to be registered to the subscription service and immediately subscribed to the subscription which best matches its architecture in a single step.
[root@server1 ~]# subscription-manager register --username admin-example --password secret --autosubscribe
--activationkey
option.
--org
option, but in multi-org environments, the --org
option is required. The organization is not defined as part of the activation key. See 14.12절. “Working with Subscription Asset Manager” for information about activation keys and Subscription Asset Manager.
# subscription-manager register --activationkey=1234abcd --org="IT Dept"
Options | Description | Required |
---|---|---|
--username=name | Gives the content server user account name. | Required |
--password=password | Gives the password for the user account. | Required |
--org=name | Gives the organization to which to join the system. | Required, except for hosted environments |
--environment=name | Registers the consumer to an environment within an organization. | Optional |
--name=machine_name | Sets the name of the consumer (machine) to register. This defaults to be the same as the hostname. | Optional |
--autosubscribe | Automatically subscribes this system to the best-matched compatible subscription. This is good for automated setup operations, since the system can be configured in a single step. | Optional |
--activation_key | Applies existing subscriptions as part of the registration process. The subscriptions are pre-assigned by a vendor or by a systems administrator using Subscription Asset Manager. | Optional |
--force | Registers the system even if it is already registered. Normally, any register operations will fail if the machine is already registered. | Optional |
unregister
command. This removes the system's entry from the subscription service, unsubscribes it from any subscriptions, and, locally, deletes its identity and entitlement certificates.
unregister
.
[root@server1 ~]# subscription-manager unregister
register
command. This command passes the original UUID for a system to issue a request to the subscription service to receive a new certificate using the same UUID. This essentially renews its previous registration.
register
command uses the original ID to identify itself to the subscription service and restore its previous subscriptions.
[root@server1 ~]# subscription-manager register --username admin-example --password secret --consumerid=7d133d55-876f-4f47-83eb-0ee931cb0a97
Options | Description | Required |
---|---|---|
--consumerid | Gives the consumer UUID used by an existing consumer. The system's consumer entry must exist in the Red Hat subscription service for the reregister operation to succeed. | Required |
--username=name | Gives the content server user account name. | Optional |
--password=password | Gives the password for the user account. | Optional |
rhn-migrate-classic-to-rhsm
install-num-migrate-to-rhsm
[root@server ~]# yum install subscription-manager-migration subscription-manager-migration-data
rhn-migrate-classic-to-rhsm
script.
rhn-migrate-classic-to-rhsm
script has this syntax:
rhn-migrate-classic-to-rhsm [--force|--cli-only|--help|--no-auto]
[root@server ~]# subscription-manager facts --list | grep migr migration.classic_system_id: 09876 migration.migrated_from: rhn_hosted_classic
rhn-migrate-classic-to-rhsm
tool migrates the system profile and then opens the Subscription Manager GUI so that administrators can assign subscriptions to the system.
[root@server ~]# rhn-migrate-classic-to-rhsm RHN Username: jsmith@example.com Password:
Retrieving existing RHN classic subscription information ... +----------------------------------+ System is currently subscribed to: +----------------------------------+ rhel-i386-client-5
/etc/pki/product
directory.
List of channels for which certs are being copied rhel-i386-client-5 Product Certificates copied successfully to /etc/pki/product !!
Preparing to unregister system from RHN classic ... System successfully unregistered from RHN Classic.
Attempting to register system to Certificate-based RHN ... The system has been registered with id: abcd1234 System server.example.com successfully registered to Certificate-based RHN. Launching the GUI tool to manually subscribe the system ...
rhn-migrate-classic-to-rhsm
can automatically subscribe the system to matching subscriptions.
--cli-only
option tells the rhn-migrate-classic-to-rhsm
to register the system with the autosubscribe option, so all of the migration process occurs in the command line.
[root@server ~]# rhn-migrate-classic-to-rhsm --cli-only RHN Username: jsmith@example.com Password: .... Attempting to auto-subscribe to appropriate subscriptions ... Installed Product Current Status: ProductName: Red Hat Enterprise Linux Desktop Status: Subscribed Please visit https://access.redhat.com/management/consumers/abcd1234 to view the details, and to make changes if necessary.
rhn-migrate-classic-to-rhsm
tool can be used simply to unregister a system from RHN Classic. This still copies over the product certificates for the classic channels to configure the system in the style of certificate-based subscriptions, but it does not register the machine with subscription service.
--no-auto
option.
[root@server ~]# rhn-migrate-classic-to-rhsm --no-auto RHN Username: jsmith@example.com Password: Retrieving existing RHN classic subscription information ... +----------------------------------+ System is currently subscribed to: +----------------------------------+ rhel-i386-client-5 List of channels for which certs are being copied rhel-i386-client-5 Product Certificates copied successfully to /etc/pki/product !! Preparing to unregister system from RHN classic ... System successfully unregistered from RHN Classic.
rhn-migrate-classic-to-rhsm
uses the information in /etc/sysconfig/rhn/systemid
to get the previous registration information and map channels to certificates. If a system is disconnected, it may not have a systemid
file.
/etc/sysconfig/rhn/install-num file
.
[root@server ~]# python /usr/lib/python2.4/site-packages/instnum.py da3122afdb7edd23 Product: RHEL Client Type: Installer Only Options: Eval FullProd Workstation Allowed CPU Sockets: Unlimited Allowed Virtual Instances: Unlimited Package Repositories: Client Workstation key: 14299426 "da3122" checksum: 175 "af" options: 4416 "Eval FullProd Workstation" socklimit: -1 "Unlimited" virtlimit: -1 "Unlimited" type: 2 "Installer Only" product: 1 "client" {"Workstation": "Workstation", "Base": "Client"}
install-num-migrate-to-rhsm
script identifies the channels that a disconnected system is subscribed to and then copies in the appropriate product certificates. Simply run the command:
[root@server ~]# install-num-migrate-to-rhsm
/etc/pki/product
directory.
[root@server ~]# subscription-manager facts --list | grep migr migration.migrated_from: install_number
/usr/share/rhsm/product/RHEL-5/channel-cert-mapping.txt
) uses simple keys to map the values:
channel_name
:product_name-hash-product_cert
.pem
rhel-i386-client-workstation-5: Client-Workstation-i386-b0d4c042-6e31-45a9-bd94-ff0b82e43b1a-71.pem
.pem
and the product certificate is copied into the /etc/pki/product
directory. For the rhel-i386-client-workstation-5
, this migrates to the 71.pem
product certificate (the last two digits of the mapping).
jbappplatform-4.3.0-fp-i386-server-5-rpm: none
subscription-manager-gui
subscription-manager-gui
--pool
option.
[root@server1 ~]# subscription-manager subscribe --pool=XYZ01234567
subscribe
command are listed in 표 14.4. “subscribe Options”.
list
command:
[root@server1 ~]# subscription-manager list --available
+-------------------------------------------+
Available Subscriptions
+-------------------------------------------+
ProductName: RHEL for Physical Servers
ProductId: MKT-rhel-server
PoolId: ff8080812bc382e3012bc3845ca000cb
Quantity: 10
Expires: 2011-09-20
--auto
option (which is analogous to the --autosubscribe
option with the register
command).
[root@server1 ~]# subscription-manager subscribe --auto
Options | Description | Required |
---|---|---|
--pool=pool-id | Gives the ID for the subscription to subscribe the machine to. |
Required, unless --auto is used
|
--auto | Automatically subscribes the system to the best-match subscription or subscriptions. | Optional |
--quantity | Subscribes multiple counts of an entitlement to the system. This is used to cover subscriptions that define a count limit, like using two 2-socket server subscriptions to cover a 4-socket machine. | Optional |
unsubscribe
command with the --all
unsubscribes the system from every product and subscription pool it is currently subscribed to.
[root@server1 ~]# subscription-manager unsubscribe --all
unsubscribe
command to remove only that product subscription.
cert.pem
file or by using the list
command. For example:
[root@server1 ~]# subscription-manager list --consumed +-------------------------------------------+ Consumed Product Subscriptions +-------------------------------------------+ ProductName: High availability (cluster suite) ContractNumber: 0 SerialNumber: 11287514358600162 Active: True Begins: 2010-09-18 Expires: 2011-11-18
--serial
option to specify the certificate.
[root@server1 ~]# subscription-manager unsubscribe --serial=11287514358600162
--quantity
option. The quantity taken applies to the product in the --pool
option:
[root@server1 ~]# subscription-manager subscribe --pool=XYZ01234567 --quantity=2
.zip
file. Save the file to some kind of portable media, like a flash drive.
certificates.zip
file. Unzip the directories until the PEM files for the subscription certificates are available.
import
command:
# subscription-manager import --certificate=/tmp/export/entitlement_certificates/596576341785244687.pem --certificate=/tmp/export/entitlement_certificates/3195996649750311162.pem Successfully imported certificate 596576341785244687.pem Successfully imported certificate 3195996649750311162.pem
subscription-manager-gui
.pem
file of the product certificate.
subscription-manager-gui
redeem
command, with an email address to send the redemption email to when the process is complete.
# subscription-manager redeem --email=jsmith@example.com
# subscription-manager redeem --email=jsmith@example.com --org="IT Dept"
list
command to display different areas of the subscriptions and products on the system.
Option | Description |
---|---|
--installed (or nothing) |
Lists all of the installed and subscribed product on the system. If no option is given with list , it is the same as using the --installed argument.
|
--consumed | Lists all of the subscriptions allocated to the system. |
--available [--all] |
Using --available alone lists all of the compatible, active subscriptions for the system. Using --available --all lists all options, even ones not compatible with the system or with no more available quantities.
|
--ondate=YYYY-MM-DD |
Shows subscriptions which are active and available on the specified date. This is only used with the --available option. If this is not used, then the command uses the current date.
|
--installed | Lists all of the products that are installed on the system (and whether they have a subscription) and it lists all of the product subscriptions which are assigned to the system (and whether those products are installed). |
list
command shows all of the subscriptions that are currently allocated to the system by using the --consumed
option.
[root@server1 ~]# subscription-manager list --consumed +-------------------------------------------+ Consumed Product Subscriptions +-------------------------------------------+ ProductName: Red Hat Enterprise Linux Server ContractNumber: 1458961 SerialNumber: 171286550006020205 Active: True Begins: 2009-01-01 Expires: 2011-12-31
list
command shows all of the subscriptions that are compatible with and available to the system using the --available
option. To include every subscription the organization has — both the ones that are compatible with the system and others for other platforms — use the --all
option with the --available
. The --ondate
option shows only subscriptions which are active on that date, based on their activation and expiry dates.
[root@server1 ~]# subscription-manager list --available --all
+-------------------------------------------+
Available Subscriptions
+-------------------------------------------+
ProductName: RHEL for Physical Servers
ProductId: MKT-rhel-server
PoolId: ff8080812bc382e3012bc3845ca000cb
Quantity: 10
Expires: 2011-09-20
ProductName: RHEL Workstation
ProductId: MKT-rhel-workstation-mkt
PoolId: 5e09a31f95885cc4
Quantity: 10
Expires: 2011-09-20
[snip]
--installed
option correlates the products that are actually installed on the system (and their subscription status) and the products which could be installed on the system based on the assigned subscriptions (and whether those products are installed).
[root@server1 ~]# subscription-manager list --installed
+-------------------------------------------+
Installed Product Status
+-------------------------------------------+
ProductName: Red Hat Enterprise Linux
Status: Not Subscribed
Expires:
Subscription:
ContractNumber:
AccountNumber:
ProductName: Awesome OS Server
Status: Not Installed
Expires: 2012-02-20
Subscription: 54129829316535230
ContractNumber: 39
AccountNumber: 12331131231
yum
. Subscription Manager has its own yum
plug-ins: product-id
for subscription-related information for products and subscription-manager
which is used for the content repositories.
baseurl
parameter of the rhsm.conf
file.
[root@server ~]# yum repolist all repo id repo name status rhel-5-server Red Hat Enterprise Linux 5Server - enabled: 1,749 rhel-5-server-beta Red Hat Enterprise Linux 5Server Be enabled: 869 rhel-5-server-optional-rpms Red Hat Enterprise Linux 5Server Op disabled rhel-5-server-supplementary Red Hat Enterprise Linux 5Server Su disabled
rhel-5-server-optional-rpms
and rhel-5-server-supplementary
, respectively.
yum-config-manager
command:
[root@server ~]# yum-config-manager --enable rhel-5-server-optional-rpms
yum
. This uses the --enablerepo
repo_name option. For example:
# yum install rubygems --enablerepo=rhel-5-server-optional-rpms Loaded plugins:product-id
, refresh-packagekit,subscription-manager
Updating Red Hat repositories. ....
yum
is described in 13장. YUM (Yellowdog Updater Modified).
[root@server ~]# subscription-manager list
+-------------------------------------------+
Installed Product Status
+-------------------------------------------+
ProductName: Red Hat Enterprise Linux Server
Status: Not Subscribed
Expires:
SerialNumber:
ContractNumber:
AccountNumber:
rhsmcertd
. This daemon checks the certificate validity dates daily. If a subscription is within 24 hours of expiring, then Subscription Manager will check for any available compatible subscriptions and automatically re-subscribes the system, much like auto-subscribing during registration.
autoheal
parameter to the Subscription Manager configuration.
vim /etc/rhsm/rhsm.conf
[rhsmcertd]
area, add the autoheal
line, and set the value to true.
[rhsmcertd]
certFrequency = 240
healFrequency = 1440
autoheal = true
config
command:
[root@server1 ~]# subscription-manager config --rhsmcertd.autoheal=true
healFrequency
parameter to zero means that Subscription Manager simply uses the default time setting.
# vim /etc/rhsm/rhsm.conf
[rhsmcertd]
section, set the healFrequency
parameter to the time, in minutes, to check for changed subscriptions.
[rhsmcertd] certFrequency = 240 healFrequency = 1440
rhsmcertd
daemon to reload the configuration.
# service rhsmcertd start
hostname
parameter in the [server]
area in the rhsm.conf
configuration file. The content delivery network URL is configured in the baseurl
parameter in the [rhsm]
area. These values can be reset using the config
command. For example:
[root@server1 ~]# subscription-manager config --server.hostname=sam.example.com --rhsm.baseurl=sam.example.com
config
command is covered in 14.14.2절. “Using the config Command”.
orgs
, environments
, and repos
commands list the organization, environment, and repository information for the system, depending on the organization and environments it belongs to.
[root@server1 ~]# subscription-manager orgs --username=jsmith --password=secret +-------------------------------------------+ admin Organizations +-------------------------------------------+ OrgName: Admin Owner OrgKey: admin OrgName: Dev East OrgKey: deveast OrgName: Dev West OrgKey: devwest [root@server1 ~]# subscription-manager environments --username=jsmith --password=secret --org=admin +-------------------------------------------+ Environments +-------------------------------------------+ Name: Locker Description: None Name: Dev Description: Name: Prod Description: [root@server1 ~]# subscription-manager repos --list +----------------------------------------------------------+ Entitled Repositories in /etc/yum.repos.d/redhat.repo +----------------------------------------------------------+ RepoName: never-enabled-content RepoId: never-enabled-content RepoUrl: https://content.example.com/repos/optional Enabled: 0 RepoName: always-enabled-content RepoId: always-enabled-content RepoUrl: https://content.example.com/repos/dev Enabled: 1 RepoName: content RepoId: content-label RepoUrl: https://content.example.com/repos/prod Enabled: 1
.pem
file.
https://access.redhat.com/
certificates.zip
file. Unzip the directories until the PEM files for the entitlement certificates are available.
import
command:
# subscription-manager import --certificate=/tmp/export/entitlement_certificates/596576341785244687.pem --certificate=/tmp/export/entitlement_certificates/3195996649750311162.pem Successfully imported certificate 596576341785244687.pem Successfully imported certificate 3195996649750311162.pem
refresh
command updates all of the subscription information that is available to the consumer. This removes expired subscriptions and adds new subscriptions to the list. This does not subscribe the machine, but it does pull in the newest data for administrators to use.
[root@server1 ~]# subscription-manager refresh
rhsm.conf
configuration file. There are other support files that either influence the Red Hat Subscription Manager service or can help administrators better use the Subscription Manager.
File or Directory | Description |
---|---|
/etc/rhsm | The primary Red Hat Subscription Manager configuration directory. |
/etc/rhsm/rhsm.conf | The Red Hat Subscription Manager configuration file. This is used by both the GUI and the CLI. |
/etc/rhsm/facts |
Any user-defined JSON files that override or add system facts to determine entitlement compatibility. Any facts files must end in .facts .
|
/var/lib/rhsm/cache/installed_products.json | A master list of installed products, which is sent by Subscription Manager to a hosted content service, such as Subscription Asset Manager. |
/var/lib/rhsm/facts/facts.facts | The default system facts filed, gathered by the Subscription Manager. |
/var/lib/rhsm/packages/ | The package profile cache (a list of installed products) which is gathered and periodically updated by the Subscription Manager. |
/var/log/rhsm | The Red Hat Subscription Manager log directory. |
/var/log/rhsm/rhsm.log | The log for the Red Hat Subscription Manager tools. |
/var/log/rhsm/rhsmcertd.log |
The log for the Red Hat Subscription Manager daemon, rhsmcertd .
|
/etc/pki/consumer | The directory which contains the identity certificates used by the system to identify itself to the subscription service. |
/etc/pki/consumer/cert.pem | The base-64 consumer identity certificate file. |
/etc/pki/consumer/key.pem | The base-64 consumer identity key file. |
/etc/pki/entitlement | The directory which contains the entitlement certificates for the available subscriptions. |
/etc/pki/product/product_serial# .pem
| The product certificates for installed software products. |
/var/run/subsys/rhsm | Runtime files for Red Hat Subscription Manager |
/etc/init.d/rhsmcertd | The subscription certificate daemon. |
/etc/cron.daily/rhsm-complianced and /usr/libexec/rhsm-complianced | Files to run daily checks and notifications for subscription validity. |
/etc/yum/pluginconf.d/rhsmplugin.conf |
The configuration file to include the Red Hat Subscription Manager plug-in in the yum configuration.
|
/usr/share/rhsm | All of the Python and script files used by both Red Hat Subscription Manager tool to perform subscription tasks. |
/usr/share/rhsm/gui | All of the Python script and image files used to render the Red Hat Subscription Manager GUI. |
rhsm.conf
. This file configures several important aspects of how Red Hat Subscription Manager interacts with both entitlements and content services:
rhsm.conf
file is divided into three sections. Two major sections defined the subscription service ([server]
) and content and product delivery ([rhsm]
). The third section relates to the rhsmcertd
daemon. Each assertion is a simple attribute= value pair. Any of the default values can be edited; all possible attributes are present and active in the default rhsm.conf
file.
# Red Hat Subscription Manager Configuration File: # Unified Entitlement Platform Configuration [server] # Server hostname: hostname = subscription.rhn.redhat.com # Server prefix: prefix = /subscription # Server port: port = 443 # Set to 1 to disable certificate validation: insecure = 0 # Set the depth of certs which should be checked # when validating a certificate ssl_verify_depth = 3 # Server CA certificate location: ca_cert_dir = /etc/rhsm/ca/ # an http proxy server to use proxy_hostname = # port for http proxy server proxy_port = # user name for authenticating to an http proxy, if needed proxy_user = # password for basic http proxy auth, if needed proxy_password = [rhsm] # Content base URL: baseurl= https://cdn.redhat.com # Default CA cert to use when generating yum repo configs: repo_ca_cert = %(ca_cert_dir)sredhat-uep.pem # Where the certificates should be stored productCertDir = /etc/pki/product entitlementCertDir = /etc/pki/entitlement consumerCertDir = /etc/pki/consumer [rhsmcertd] # Frequency of certificate refresh (in minutes): certFrequency = 240 # Frequency of autoheal check (1440 min = 1 day): healFrequency = 1440
Parameter | Description | Default Value |
---|---|---|
[server] Parameters | ||
hostname | Gives the IP address or fully-qualified domain name of the subscription service. | subscription.rhn.redhat.com |
prefix | Gives the directory, in the URL, to use to connect to the subscription service. | /subscription |
port | Gives the port to use to connect to the subscription service. | 443 |
insecure | Sets whether to use a secure (0) or insecure (1) connection for connections between the Subscription Manager clients and the subscription service. | 0 |
ssl_verify_depth | Sets how far back in the certificate chain to verify the certificate. | 3 |
proxy_hostname | Gives the hostname of the proxy server. This is required. | |
proxy_port | Gives the port of the proxy server. This is required. | |
proxy_user | Gives the user account to use to access the proxy server. This may not be required, depending on the proxy server configuration. | |
proxy_password | Gives the password credentials to access the proxy server. This may not be required, depending on the proxy server configuration. | |
ca_cert_dir | Gives the location for the CA certificate for the CA which issued the subscription service's certificates. This allows the client to identify and trust the subscription service for authentication for establishing an SSL connection. | /etc/rhsm/ca |
[rhsm] Parameters | ||
baseurl | Gives the full URL to access the content delivery system. | https://cdn.redhat.com |
repo_ca_cert | Identifies the default CA certificate to use to set the yum repo configuration. | %(ca_cert_dir)sredhat-uep.pem |
showIncompatiblePools |
Sets whether to display subscription pools which are not compatible with the system's architecture but which have been purchased by an organization. By default, Subscription Manager only displays subscriptions which are compatible with, and therefore available to, the system.
This parameter only applies to the Subscription Manager GUI. Incompatible subscriptions can be displayed in the CLI by using the
--all option with the list command.
| 0 |
productCertDir | Sets the root directory where the product certificates are stored and can be accessed by Subscription Manager. | /etc/pki/product |
consumerCertDir | Sets the directory where the identity certificate for the system is stored and can be accessed by Subscription Manager. | /etc/pki/consumer |
entitlementCertDir | Sets the directory where the entitlement certificates for the system are stored and can be accessed by Subscription Manager. Each subscription has its own entitlement certificate. | /etc/pki/entitlement |
[rhsmcertd] Parameters | ||
certFrequency | Sets the interval, in minutes, to check and update entitlement certificates used by Subscription Manager. | 240 |
healFrequency | Sets the interval, in minutes, to check for change subscriptions and installed products and to allocate subscriptions, as necessary, to maintain subscription status for all products. | 240 |
subscription-manager
has a subcommand that can change the rhsm.conf
configuration file. Almost all of the connection information used by Subscription Manager to access the subscription server, content server, and any proxies is set in the configuration file, as well as general configuration parameters like the frequency Subscription Manager checks for entitlements updates. There are major divisions in the rhsm.conf
file, such as [server]
which is used to configure the subscription server. When changing the Subscription Manager configuration, the settings are identified with the format section.parameter and then the new value. For example:
server.hostname=newsubscription.example.com
config
command:
[root@server1 ~]# subscription-manager config --section.parameter
=newValue
[root@server1 ~]# subscription-manager config --server.hostname=subscription.example.com
rhsm.conf
file parameters are listed in 표 14.7. “rhsm.conf Parameters”. This is most commonly used to change connection settings:
config
command also has a --remove
option. This deletes the the current value for the parameter without supplying a new parameter. A blank value tells Subscription Manager to use any default values that are set for that parameter rather than a user-defined value. For example:
[root@server1 ~]# subscription-manager config --remove=rhsm.certFrequency The default value for rhsm.certFrequency will now be used.
[root@server1 ~]# subscription-manager config --remove=server.proxy You have removed the value in section server for parameter proxy.
subscription-manager-gui
rhsm.conf
file; this is the same as configuring it in the Subscription Manager GUI. The proxy configuration is stored and used for every connection between the subscription service and the local system.
vim /etc/rhsm/rhsm.conf
[server]
section that relate to the HTTP proxy. All parameters are described in 표 14.7. “rhsm.conf Parameters”. There are four parameters directly related to the proxy:
proxy_hostname
for the IP address or fully-qualified domain name of the proxy server; this is required.
proxy_hostname
argument blank means that no HTTP proxy is used.
proxy_port
for the proxy server port.
proxy_user
for the user account to connect to the proxy; this may not be required, depending on the proxy server's configuration.
proxy_password
for the password for the user account to connect to the proxy; this may not be required, depending on the proxy server's configuration.
[server] # an http proxy server to use proxy_hostname = proxy.example.com # port for http proxy server proxy_port = 443 # user name for authenticating to an http proxy, if needed proxy_user = # password for basic http proxy auth, if needed proxy_password =
subscription-manager
.
Argument | Description | Required for a Proxy Connection? |
---|---|---|
--proxy | Gives the proxy server to connect to, in the format hostname:port. | Yes |
--proxyuser | Gives the username to use to authenticate. This is only required if user authentication is required. | No |
--proxypass | Gives the password to use with the user account. This is only required if user authentication is required. | No |
subscription-manager
operation. For example:
[root@server1 ~]# subscription-manager subscribe --pool=ff8080812bc382e3012bc3845ca000cb --proxy=proxy.example.com:8443 --proxyuser=jsmith --proxypass=secret
rhsm.conf
file. The subscription service connection settings are in the [server]
section of the configuration file.
vim /etc/rhsm/rhsm.conf
[server]
section that relate to the subscription service connection. All parameters are described in 표 14.7. “rhsm.conf Parameters”. There are three parameters directly related to the connection:
hostname
for the IP address or fully-qualified domain name of the machine
prefix
for the subscription service directory
port
for the subscription service port
[server] hostname=entitlements.server.example.com prefix=/candlepin port=8443
vim /etc/rhsm/rhsm.conf
baseurl
directive in the [rhsm]
section. This is the full URL to the service.
[rhsm] # Content base URL: baseurl= http://content.example.com/content
vim /etc/rhsm/rhsm.conf
[server]
section that relate to a secure connection. All parameters are described in 표 14.7. “rhsm.conf Parameters”. There are three parameters directly related to the connection:
insecure
to set whether to use a secure (0) or insecure (1) connection
ca_cert_dir
for the directory location for the CA certificate for authentication and verification
port
for the subscription service port; this should be an SSL port if a secure connection is required
[server]
port=8443
insecure = 1
ca_cert = /etc/rhsm/ca
rhsmcertd
, runs as a service on the system. The daemon, by default, starts with the system, and it can be started, stopped, or checked with the service
command.
service rhsmcertd status rhsmcertd (pid 13084) is running...
chkconfig
”. When a system reboots, some services can be automatically restarted. chkconfig
also defines startup settings for different run levels of the server.
chkconfig
. By default, the Red Hat Subscription Manager daemon, rhsmcertd
, is configured to run at levels 3, 4, and 5, so that the service is started automatically when the server reboots.
chkconfig
. For example, to enable run level 2:
chkconfig --level 2345 rhsmcertd on
rhsmcertd
from the start list, change the run level settings off:
chkconfig --level 2345 rhsmcertd off
service
and chkconfig
settings.
system-config-services
package must be installed for the wizard to be available.
rhsmcertd
item in the list of services on the left, and then edit the service as desired.
/var/log/rhsm
directory:
rhsm.log
shows every invocation and result of running the Subscription Manager GUI or CLI
rhsmcertd.log
shows every time a new certificate is generated, which happens on a schedule defined by the certFrequency
parameter in the rhsm.conf
file.
rhsm.log
log contains the sequence of every Python call for every operation invoked through the Subscription Manager tools. Each entry has this format:
YYYY-MM-DD HH:MM:SS,process_id [MESSAGE_TYPE] call python_script response
rhsm.log
relates to the Python script or function that was called, there can be multiple log entries for a single operation.
2010-10-01 17:27:57,874 [INFO] _request() @connection.py:97 - status code: 200 2010-10-01 17:27:57,875 [INFO] perform() @certlib.py:132 - updated: Total updates: 0 Found (local) serial# [] Expected (UEP) serial# [] Added (new) <NONE> Deleted (rogue): <NONE> Expired (not deleted): <NONE> Expired (deleted): <NONE> 2010-10-01 17:27:57,878 [INFO] __init__() @connection.py:193 - Using certificate authentication: key = /etc/pki/consumer/key.pem, cert = /etc/pki/consumer/cert.pem, ca = /etc/pki/CA/candlepin.pem, insecure = True 2010-10-01 17:27:57,878 [INFO] __init__() @connection.py:196 - Connection Established: host: candlepin1.devlab.phx1.redhat.com, port: 443, handler: /candlepin
rhsmcertd.log
file are much simpler. The log only records when the rhsmcertd
daemon starts or stops and every time a certificate is updated.
Fri Oct 1 13:27:44 2010: started: interval = 240 minutes Fri Oct 1 13:27:50 2010: certificates updated
--all
option:
[root@server1 ~]# subscription-manager list --available --all
rhsm.conf
configuration file.
vim /etc/rhsm/rhsm.conf
showIncompatiblePools
directive in the [rhsm]
section. A value of 0
shows only compatible entitlements.
[rhsm]
# Content base URL:
showIncompatiblePools = 1
/etc/redhat-release
or /etc/sysconfig
. In both the Red Hat Subscription Manager GUI and CLI, the facts are represented as simple attribute: value pairs.
subscription-manager-gui
facts
with the --list
option.
[root@server1 ~]# subscription-manager facts --list cpu.architecture: i686 cpu.core(s)_per_socket: 4 cpu.cpu(s): 4 cpu.cpu_family: 6 cpu.cpu_mhz: 2000.010 cpu.cpu_op-mode(s): 32-bit, 64-bit cpu.cpu_socket(s): 1 cpu.l1d_cache: 32K cpu.l1i_cache: 32K cpu.l2_cache: 6144K cpu.model: 23 cpu.stepping: 6 cpu.thread(s)_per_core: 1 cpu.vendor_id: GenuineIntel cpu.virtualization: VT-x distribution.id: Santiago distribution.name: Red Hat Enterprise Linux Workstation distribution.version: 5 dmi.baseboard.manufacturer: IBM dmi.baseboard.product_name: Server Blade ... [snip] ...
--update
option with the facts
command.
[root@server1 ~]# subscription-manager facts --update
/var/lib/rhsm/facts/facts.facts
. These facts are stored as attribute: value pairs, in a comma-separated list.
{"fact1": "value1","fact2": "value2"}
/etc/rhsm/facts
directory. These JSON files can override existing facts or even add new facts to be used by the subscription service.
vim /etc/rhsm/facts/my-example.facts {"uname.machine": "x86","kernel_version": "2.6.32","physical_location": "MTV colo rack 5"}
identity
command. Although not required, using the --force
option will require the username and password and will cause the Subscription Manager to prompt for the credentials if they are not passed in the command:
[root@server1 ~]# subscription-manager identity --regenerate --force Username: jsmith@example.com Password: Identity certificate has been regenerated.
identity
command to return the current UUID. The UUID is the Current identity is value.
[root@server1 ~]# subscription-manager identity Current identity is: 63701087-f625-4519-8ab2-633bb50cb261 name: server1.example.com org name: 6340056 org id: 8a85f981302cbaf201302d89931e059a
list --installed
command with the command-line tools.
rhsmcertd
, checks the system periodically — once when it is first registered and then when it runs a refresh operation every four hours — to get the most current list of installed products. When the system is registered and then whenever there is a change to the package list, Subscription Manager sends an updated package profile to the subscription service.
/var/lib/rhsm/packages/
.
subscription-manager
script. Information like the consumer ID or subscription pool ID is pulled up and referenced automatically in the Red Hat Subscription Manager UI, but it has to be entered manually in the command line.
Information | Description | Operations Used In | Find It In ... |
---|---|---|---|
Consumer ID | A unique identifier for each system that is registered to the subscription service. | identity |
The simplest method is to use the identity command to return the current UUID.
[root@server1 ~]# subscription-manager identity Current identity is: 63701087-f625-4519-8ab2-633bb50cb261 name: consumer-1.example.com org name: 6340056 org id: 8a85f981302cbaf201302d89931e059aThe Subject CN element of the identity certificate for the system, /etc/pki/consumer/cert.pem . The UUID can also be returned by using openssl to pretty-print the certificate.
openssl x509 -text -in /etc/pki/consumer/cert.pem Certificate: ... snip ... Subject: CN=7d133d55 876f 4f47 83eb 0ee931cb0a97 |
Pool ID | An identifier for a specific set of subscriptions. This set is created when subscriptions are purchased. Whenever a system needs to subscribe to a product, it references a pool ID to identify which purchased set of subscriptions to use. | subscribe |
The PoolID value given for a product when listing available subscriptions. For example:
[root@server1 ~]# subscription-manager list --available +----------------------+ Available Subscriptions +----------------------+ ProductName: Red Hat Enterprise Linux, Standard (up to 2 sockets) 3 year ProductId: MCT0346F3 PoolId: ff8080812bc382e3012bc3845ca000cb Quantity: 2 Expires: 2011-02-28 |
Product certificate serial number | The identification used for a specific, installed product. A certificate with a unique serial number is generated when a product is installed; this serial number is used to identify that specific product installation when managing subscriptions. | unsubscribe |
The SerialNumber line in the product subscription information. This can be returned by running list --consumed .
[root@server1 ~]# subscription-manager list --consumed +-----------------------------+ Consumed Product Subscriptions +-----------------------------+ ProductName: High availability (cluster suite) ContractNumber: 0 SerialNumber: 11287514358600162 .... |
Product ID | The internal identifier used to identify a type of product. |
The ProductID value given for a product when listing available subscriptions. For example:
[root@server1 ~]# subscription-manager list --available +----------------------+ Available Subscriptions +----------------------+ ProductName: RHEL for Physical Servers ProductId: MKT-rhel-server ... snip ... |
.pem
formatted file. This file format stores both keys and certificates in a base-64 blob. For example:
-----BEGIN CERTIFICATE----- MIIDaTCCAtKgAwIBAgICBZYwDQYJKoZIhvcNAQEFBQAwSzEqMCgGA1UEAxMhY2Fu ZGxlcGluMS5kZXZsYWIucGh4MS5yZWRoYXQuY29tMQswCQYDVQQGEwJVUzEQMA4G A1UEBxMHUmFsZWlnaDAeFw0xMDEwMDYxNjMyMDVaFw0xMTEwMDYyMzU5NTlaMC8x LTArBgNVBAMMJDQ4ODFiZDJmLTg2OGItNDM4Yy1hZjk2LThiMWQyODNkYWZmYzCC ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKNyLw6+IMtjY03F7Otxj2GL GTz5VKx1kfWY7q4OD4w+XlBHTkt+2tQV9S+4TFkUZ7XoI80LDL/BONpy/gq5c5cw yKvjv2gjSS/pihgYNXc5zUOIfSj1vb3fHGHOkzdCcZMyWq1z0N/zaLClp/zP/pcM og4NTAg2niNPjFYvkQ+oIl16WmQpefM0y0SY7N7oJd2T8dZjOiuLV2cVZLfwjrwG 9UpkT2J03g+n1ZA9q95ibLD5NVOdTy9+2lfRhdDViZaVoFiQXvg86qBHQ0ieENuF a6bCvGgpTxcBuVXmsnl2+9dnMiwoDqPZp1HB6G2uNmyNe/IvkTOPFJ/ZVbtBTYUC AwEAAaOB8zCB8DARBglghkgBhvhCAQEEBAMCBaAwCwYDVR0PBAQDAgSwMHsGA1Ud IwR0MHKAFGiY1N2UtulxcMFy0j6gQGLTyo6CoU+kTTBLMSowKAYDVQQDEyFjYW5k bGVwaW4xLmRldmxhYi5waHgxLnJlZGhhdC5jb20xCzAJBgNVBAYTAlVTMRAwDgYD VQQHEwdSYWxlaWdoggkA1s54sVacN0EwHQYDVR0OBBYEFGbB5fqOzh32g4Wqrwhc /96IupIgMBMGA1UdJQQMMAoGCCsGAQUFBwMCMB0GA1UdEQQWMBSkEjAQMQ4wDAYD VQQDDAV4ZW9wczANBgkqhkiG9w0BAQUFAAOBgQANxHRsev4fYfnHO9kYcHo4UeK7 owN+fq92gl76iRHRnhzkPlhWL+uV2tyqGG9zJASOX+qEDOqN5sVAB4iNQTDGiUbK z757igD2hsQ4ewv9Vq3QtnajWnfdaUZH919GgWs09Etg6ucsKwgfx1fqjSRLBbOo lZuvBTYROOX6W2vKXw== -----END CERTIFICATE-----
openssl
or pk12util
can be used to extract and view information from these certificates, in a pretty-print format. The product- and subscription-related information is extracted and viewable in the Red Hat Subscription Manager GUI or command-line tools.
Certificate Type | Description | Default Location |
---|---|---|
Consumer Identity Certificate | Used to identify the system (consumer) to the subscription service. This contains a unique ID which is assigned to the system when it is registered to the system. The identity certificate itself is generated by the subscription service when the system is registered and then sent to the consumer. | /etc/pki/consumer |
Entitlement Certificate | Contains a list of products that are available to a system to install, based on the subscriptions that the system has been subscribed to. The entitlement certificate defines the software products, the content delivery location, and validity dates. The presence of an entitlement certificate means that the system has consumed one of the quantities from the subscription. | /etc/pki/entitlement |
Product Certificate | Contains the information about a product after it has been installed. |
/etc/pki/product/product_serial# .pem
|
CA Certificate | A certificate for the certificate authority which issued the SSL server certificate used by the subscription service. This must be installed on a system for the system to use SSl to connect to the subscription service. | /etc/rhsm/ca/candlepin-ca.pem |
Satellite Certificate | An XML-formatted certificate which contains a product list. This is used by local Satellite 5.x systems, not the newer subscription service. |
Certificate: Data: Version: 3 (0x2) Serial Number: 1430 (0x596) Signature Algorithm: sha1WithRSAEncryptionIssuer: CN=entitlement.server.example.com, C=US, L=Raleigh
Validity Not Before: Oct 6 16:32:05 2010 GMT Not After : Oct 6 23:59:59 2011 GMTSubject: CN=4881bd2f-868b-438c-af96-8b1d283daffc
Subject Public Key Info: Public Key Algorithm: rsaEncryption Public-Key: (2048 bit) Modulus: 00:a3:72:2f:0e:be:20:cb:63:63:4d:c5:ec:eb:71: 8f:61:8b:19:3c:f9:54:ac:75:91:f5:98:ee:ae:0e: 0f:8c:3e:5e:50:47:4e:4b:7e:da:d4:15:f5:2f:b8: 4c:59:14:67:b5:e8:23:cd:0b:0c:bf:c1:38:da:72: fe:0a:b9:73:97:30:c8:ab:e3:bf:68:23:49:2f:e9: 8a:18:18:35:77:39:cd:43:88:7d:28:f5:bd:bd:df: 1c:61:ce:93:37:42:71:93:32:5a:ad:73:d0:df:f3: 68:b0:a5:a7:fc:cf:fe:97:0c:a2:0e:0d:4c:08:36: 9e:23:4f:8c:56:2f:91:0f:a8:22:5d:7a:5a:64:29: 79:f3:34:cb:44:98:ec:de:e8:25:dd:93:f1:d6:63: 3a:2b:8b:57:67:15:64:b7:f0:8e:bc:06:f5:4a:64: 4f:62:74:de:0f:a7:d5:90:3d:ab:de:62:6c:b0:f9: 35:53:9d:4f:2f:7e:da:57:d1:85:d0:d5:89:96:95: a0:58:90:5e:f8:3c:ea:a0:47:43:48:9e:10:db:85: 6b:a6:c2:bc:68:29:4f:17:01:b9:55:e6:b2:79:76: fb:d7:67:32:2c:28:0e:a3:d9:a7:51:c1:e8:6d:ae: 36:6c:8d:7b:f2:2f:91:33:8f:14:9f:d9:55:bb:41: 4d:85 Exponent: 65537 (0x10001) X509v3 extensions: Netscape Cert Type: SSL Client, S/MIME X509v3 Key Usage: Digital Signature, Key Encipherment, Data Encipherment X509v3 Authority Key Identifier: keyid:68:98:D4:DD:94:B6:E9:71:70:C1:72:D2:3E:A0:40:62:D3:CA:8E:82 DirName:/CN=entitlement.server.example.com/C=US/L=Raleigh serial:D6:CE:78:B1:56:9C:37:41 X509v3 Subject Key Identifier: 66:C1:E5:FA:8E:CE:1D:F6:83:85:AA:AF:08:5C:FF:DE:88:BA:92:20 X509v3 Extended Key Usage: TLS Web Client AuthenticationX509v3 Subject Alternative Name:
DirName:/CN=admin-example
Signature Algorithm: sha1WithRSAEncryption 0d:c4:74:6c:7a:fe:1f:61:f9:c7:3b:d9:18:70:7a:38:51:e2: bb:a3:03:7e:7e:af:76:82:5e:fa:89:11:d1:9e:1c:e4:3e:58: 56:2f:eb:95:da:dc:aa:18:6f:73:24:04:8e:5f:ea:84:0c:ea: 8d:e6:c5:40:07:88:8d:41:30:c6:89:46:ca:cf:be:7b:8a:00: f6:86:c4:38:7b:0b:fd:56:ad:d0:b6:76:a3:5a:77:dd:69:46: 47:f7:5f:46:81:6b:34:f4:4b:60:ea:e7:2c:2b:08:1f:c7:57: ea:8d:24:4b:05:b3:a8:95:9b:af:05:36:11:38:e5:fa:5b:6b: ca:5f
*.pem
file stored in the entitlement certificates directory, /etc/pki/entitlement
. The name of the *.pem
file is a generated numeric identifier that is generated by the subscription service. This ID is an inventory number that is used to associate a subscription quantity with the system in the software inventory.
Certificate: Data: Version: 3 (0x2) Serial Number: 3c:da:6c:06:90:7f:ff Signature Algorithm: sha1WithRSAEncryption Issuer: CN=candlepin1.devlab.phx1.redhat.com, C=US, L=Raleigh Validity Not Before: Oct 8 17:55:28 2010 GMT Not After : Oct 2 23:59:59 2011 GMT Subject: CN=8a878c912b875189012b8cfbc3f2264a ... [snip] ...
1.3.6.1.4.1.2312.9.2
.product_#
.config_#
: ..config_value
2
indicates that it is a product entry. product_# is a unique ID which identifies the specific product or variant. config_# relates to the installation information for that product, like its content server or the quantity available.
1.3.6.1.4.1.2312.9
. The subsequent numbers identify different subscription areas:
.2.
is the product-specific information
.1.
is the subscription information
.4.
contains the contract information, like its ID number and start and end dates
.5.
contains the consumer information, like the consumer ID which installed a product
content repository type
1.3.6.1.4.1.2312.9.2.30393.1: ..yumproduct
1.3.6.1.4.1.2312.9.2.30393.1.1: .HRed Hat Enterprise Linux High Availability (for RHEL Entitlement) (RPMs)channel name
1.3.6.1.4.1.2312.9.2.30393.1.2: .Dred-hat-enterprise-linux-high-availability-for-rhel-entitlement-rpmsvendor
1.3.6.1.4.1.2312.9.2.30393.1.5: ..Red Hatdownload URL
1.3.6.1.4.1.2312.9.2.30393.1.6: .Q/content/dist/rhel/entitlement/releases/$releasever/$basearch/highavailability/oskey download URL
1.3.6.1.4.1.2312.9.2.30393.1.7: .2file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-releaseflex quantity
1.3.6.1.4.1.2312.9.2.30393.1.4: ..0quantity
1.3.6.1.4.1.2312.9.2.30393.1.3: ..25repo enabled setting
1.3.6.1.4.1.2312.9.2.30393.1.8: ..1
*.pem
file stored in the entitlement certificates directory, /etc/pki/product/product_serial#
.pem
. The name of the *.pem
file is a generated numeric identifier that is generated by the subscription service. As with entitlement tracking, the generated ID is an inventory number, used to track installed products and associate them with systems within the subscription service.
<rhn-cert-field name="configuration_area">value</rhn-cert-field>
name
argument identifies what entity is being configured. This can be the organization which ordered the subscription (name="owner"
), the start and end dates for the entitlement (name="issued"
and name="expires"
), or the entitlement itself. A system entitlement uses the name
argument to set the service being entitled; every content entitlement is set as a name="channel-family"
type, with the specific product identified in an additional family
argument.
name
argument, while the value is between the tags. The last lines of the certificate also set metadata for the subscription, including the version of the Satellite and the signature that signs the XML document (and allows the XML file to be used as a certificate).
<rhn-cert-field name="product">RHN-SATELLITE-001</rhn-cert-field> <rhn-cert-field name="owner">Example Corp</rhn-cert-field> <rhn-cert-field name="issued">2009-04-07 10:18:33</rhn-cert-field> <rhn-cert-field name="expires">2009-11-25 00:00:00</rhn-cert-field> ... [snip] ... <rhn-cert-field name="satellite-version">5.3</rhn-cert-field> <rhn-cert-field name="generation">2</rhn-cert-field> <rhn-cert-signature> -----BEGIN PGP SIGNATURE----- Version: Crypt::OpenPGP 1.03 iQBGBAARAwAGBQJJ22C+AAoJEJ5ynaAAAAkyyZ0An18+4hK5Ozt4HWieFvahsTnF aPcaAJ0e5neOfdDZRLOgDE+Tp/Im3Hc3Rg== =gqP7 -----END PGP SIGNATURE----- </rhn-cert-signature>
name="slot"
field lists how many total systems are allowed to use this Satellite certificate to receive content. It is a global quantity.
<rhn-cert-field name="slots">119</rhn-cert-field>
name
argument and then setting the quantity as the value within the tags.
<rhn-cert-field name="provisioning-slots">117</rhn-cert-field> <rhn-cert-field name="monitoring-slots">20</rhn-cert-field> <rhn-cert-field name="virtualization_host">67</rhn-cert-field>
rhel-server
family, while a specific Virtualization Server subscription provides an additional rhel-server-vt
family..
<rhn-cert-field name="channel-families" quantity="95" family="rhel-server"/> <rhn-cert-field name="channel-families" quantity="67" family="rhel-server-vt"/>
rhel-*
family, because that refers to the platform the product is supported on. In this example, Red Hat Directory Server is in the rhel-rhdirserv
family.
<rhn-cert-field name="channel-families" quantity="3" family="rhel-rhdirserv"/>
<rhn-cert-field name="channel-families" quantity="212" family="rhn-tools"/>
차례
sysconfig
Directory/etc/sysconfig/
Directory/etc/sysconfig/amd
/etc/sysconfig/apmd
/etc/sysconfig/arpwatch
/etc/sysconfig/authconfig
/etc/sysconfig/autofs
/etc/sysconfig/clock
/etc/sysconfig/desktop
/etc/sysconfig/dhcpd
/etc/sysconfig/exim
/etc/sysconfig/firstboot
/etc/sysconfig/gpm
/etc/sysconfig/hwconf
/etc/sysconfig/i18n
/etc/sysconfig/init
/etc/sysconfig/ip6tables-config
/etc/sysconfig/iptables-config
/etc/sysconfig/irda
/etc/sysconfig/keyboard
/etc/sysconfig/kudzu
/etc/sysconfig/named
/etc/sysconfig/network
/etc/sysconfig/nfs
/etc/sysconfig/ntpd
/etc/sysconfig/radvd
/etc/sysconfig/samba
/etc/sysconfig/selinux
/etc/sysconfig/sendmail
/etc/sysconfig/spamassassin
/etc/sysconfig/squid
/etc/sysconfig/system-config-securitylevel
/etc/sysconfig/system-config-selinux
/etc/sysconfig/system-config-users
/etc/sysconfig/system-logviewer
/etc/sysconfig/tux
/etc/sysconfig/vncservers
/etc/sysconfig/xinetd
/etc/sysconfig/
Directoryhalt
, poweroff
, and reboot
.
/etc/inittab
specifies that your system is set to shutdown and reboot in response to a Ctrl+Alt+Del key combination used at the console. To completely disable this ability, comment out the following line in /etc/inittab
by putting a hash mark (#
) in front of it:
ca::ctrlaltdel:/sbin/shutdown -t3 -r now
-a
option to the /etc/inittab
line shown above, so that it reads:
ca::ctrlaltdel:/sbin/shutdown -a -t3 -r now
-a
flag tells shutdown
to look for the /etc/shutdown.allow
file.
shutdown.allow
in /etc
. The shutdown.allow
file should list the usernames of any users who are allowed to shutdown the system using Ctrl+Alt+Del . The format of the shutdown.allow
file is a list of usernames, one per line, like the following:
stephen jack sophie
shutdown.allow
file, the users stephen
, jack
, and sophie
are allowed to shutdown the system from the console using Ctrl+Alt+Del . When that key combination is used, the shutdown -a
command in /etc/inittab
checks to see if any of the users in /etc/shutdown.allow
(or root) are logged in on a virtual console. If one of them is, the shutdown of the system continues; if not, an error message is written to the system console instead.
shutdown.allow
, refer to the shutdown
man page.
rm -f /etc/security/console.apps/*
poweroff
, halt
, and reboot
, which are accessible from the console by default.
rm -f /etc/security/console.apps/poweroff
rm -f /etc/security/console.apps/halt
rm -f /etc/security/console.apps/reboot
pam_console.so
module uses the /etc/security/console.perms
file to determine the permissions for users at the system console. The syntax of the file is very flexible; you can edit the file so that these instructions no longer apply. However, the default file has a line that looks like this:
<console>=tty[0-9][0-9]* vc/[0-9][0-9]* :[0-9]\.[0-9] :[0-9]
:0
or mymachine.example.com:1.0
, or a device like /dev/ttyS0
or /dev/pts/2
. The default is to define that local virtual consoles and local X servers are considered local, but if you want to consider the serial terminal next to you on port /dev/ttyS1
to also be local, you can change that line to read:
<console>=tty[0-9][0-9]* vc/[0-9][0-9]* :[0-9]\.[0-9] :[0-9] /dev/ttyS1
/etc/security/console.perms.d/50-default.perms
파일에 정의되어 있습니다. 파일과 장치 권한을 편집하려면 /etc/security/console.perms.d/
디렉토리에 특정 파일 또는 장치에 대한 필요한 설정이 지정된 새로운 디폴트 파일을 생성하는 것이 좋습니다. 새 디폴트 파일의 이름은 반드시 50-default.perms
파일 내용을 덮어쓸 수 있도록 50보다 큰 숫자(예, 51-default.perms
)로 시작해야 합니다.
/etc/security/console.perms.d/
디렉토리에 51-default.perms
파일을 생성하십시오:
touch /etc/security/console.perms.d/51-default.perms
perms
파일인 50-default.perms
파일을 엽니다. 첫 번째 섹션은 다음과 같은 줄로 장치 클래스를 정의합니다.
<floppy>=/dev/fd[0-1]* \ /dev/floppy/* /mnt/floppy* <sound>=/dev/dsp* /dev/audio* /dev/midi* \ /dev/mixer* /dev/sequencer \ /dev/sound/* /dev/beep \ /dev/snd/* <cdrom>=/dev/cdrom* /dev/cdroms/* /dev/cdwriter* /mnt/cdrom*
<cdrom>
refers to the CD-ROM drive. To add a new device, do not define it in the default 50-default.perms
file; instead, define it in 51-default.perms
. For example, to define a scanner, add the following line to 51-default.perms
:
<scanner>=/dev/scanner /dev/usb/scanner*
/dev/scanner
is really your scanner and not some other device, such as your hard drive.
/etc/security/console.perms.d/50-default.perms
의 두 번째 섹션은 다음과 같은 줄로 이러한 권한 정의를 다루고 있습니다:
<console> 0660 <floppy> 0660 root.floppy <console> 0600 <sound> 0640 root <console> 0600 <cdrom> 0600 root.disk
51-default.perms
에 다음과 같은 줄을 추가합니다:
<console> 0600 <scanner> 0600 root
/dev/scanner
device with the permissions of 0600 (readable and writable by you only). When you log out, the device is owned by root, and still has the permissions 0600 (now readable and writable by root only).
50-default.perms
파일을 절대 수정해서는 안 됩니다. 이미 50-default.perms
에 정의된 장치 권한을 수정하려면 51-default.perms
에 원하는 장치 권한 정의를 추가해야 합니다. 이것은 50-default.perms
에 정의된 권한과 관계없이 덮어쓰게 됩니다.
/sbin/
or /usr/sbin/
, so the application that you wish to run must be there. After verifying that, perform the following steps:
foo
program, to the /usr/bin/consolehelper
application:
cd /usr/bin
ln -s consolehelper foo
/etc/security/console.apps/foo
:
touch /etc/security/console.apps/foo
foo
service in /etc/pam.d/
. An easy way to do this is to copy the PAM configuration file of the halt
service, and then modify the copy if you want to change the behavior:
cp /etc/pam.d/halt /etc/pam.d/foo
/usr/bin/foo
is executed, consolehelper
is called, which authenticates the user with the help of /usr/sbin/userhelper
. To authenticate the user, consolehelper
asks for the user's password if /etc/pam.d/foo
is a copy of /etc/pam.d/halt
(otherwise, it does precisely what is specified in /etc/pam.d/foo
) and then runs /usr/sbin/foo
with root permissions.
pam_timestamp
and run from the same session is automatically authenticated for the user — the user does not have to enter the root password again.
pam
package. To enable this feature, add the following lines to your PAM configuration file in etc/pam.d/
:
auth include config-util account include config-util session include config-util
/etc/pam.d/system-config-*
configuration files. Note that these lines must be added below any other auth sufficient
session optional
lines in your PAM configuration file.
pam_timestamp
is successfully authenticated from the Applications (the main menu on the panel), the
floppy
Groupfloppy
group. Add the user(s) to the floppy
group using the tool of your choice. For example, the gpasswd
command can be used to add user fred
to the floppy
group:
gpasswd -a fred floppy
fred
is able to access the system's diskette drive from the console.
sysconfig
Directory/etc/sysconfig/
Directory/etc/sysconfig/amd
/etc/sysconfig/apmd
/etc/sysconfig/arpwatch
/etc/sysconfig/authconfig
/etc/sysconfig/autofs
/etc/sysconfig/clock
/etc/sysconfig/desktop
/etc/sysconfig/dhcpd
/etc/sysconfig/exim
/etc/sysconfig/firstboot
/etc/sysconfig/gpm
/etc/sysconfig/hwconf
/etc/sysconfig/i18n
/etc/sysconfig/init
/etc/sysconfig/ip6tables-config
/etc/sysconfig/iptables-config
/etc/sysconfig/irda
/etc/sysconfig/keyboard
/etc/sysconfig/kudzu
/etc/sysconfig/named
/etc/sysconfig/network
/etc/sysconfig/nfs
/etc/sysconfig/ntpd
/etc/sysconfig/radvd
/etc/sysconfig/samba
/etc/sysconfig/selinux
/etc/sysconfig/sendmail
/etc/sysconfig/spamassassin
/etc/sysconfig/squid
/etc/sysconfig/system-config-securitylevel
/etc/sysconfig/system-config-selinux
/etc/sysconfig/system-config-users
/etc/sysconfig/system-logviewer
/etc/sysconfig/tux
/etc/sysconfig/vncservers
/etc/sysconfig/xinetd
/etc/sysconfig/
Directory/etc/sysconfig/
directory contains a variety of system configuration files for Red Hat Enterprise Linux.
/etc/sysconfig/
directory, their function, and their contents. The information in this chapter is not intended to be complete, as many of these files have a variety of options that are only used in very specific or rare circumstances.
/etc/sysconfig/
Directory/etc/sysconfig/
directory. Files not listed here, as well as extra file options, are found in the /usr/share/doc/initscripts-<version-number>
/sysconfig.txt
file (replace <version-number>
with the version of the initscripts
package). Alternatively, looking through the initscripts in the /etc/rc.d/
directory can prove helpful.
/etc/sysconfig/
directory, then the corresponding program may not be installed.
/etc/sysconfig/amd
/etc/sysconfig/amd
file contains various parameters used by amd
; these parameters allow for the automatic mounting and unmounting of file systems.
/etc/sysconfig/apmd
/etc/sysconfig/apmd
file is used by apmd
to configure what power settings to start/stop/change on suspend or resume. This file configures how apmd
functions at boot time, depending on whether the hardware supports Advanced Power Management (APM) or whether the user has configured the system to use it. The apm
daemon is a monitoring program that works with power management code within the Linux kernel. It is capable of alerting users to low battery power on laptops and other power-related settings.
/etc/sysconfig/arpwatch
/etc/sysconfig/arpwatch
file is used to pass arguments to the arpwatch
daemon at boot time. The arpwatch
daemon maintains a table of Ethernet MAC addresses and their IP address pairings. By default, this file sets the owner of the arpwatch
process to the user pcap
and sends any messages to the root
mail queue. For more information regarding available parameters for this file, refer to the arpwatch
man page.
/etc/sysconfig/authconfig
/etc/sysconfig/authconfig
file sets the authorization to be used on the host. It contains one or more of the following lines:
USEMD5=<value>
, where <value>
is one of the following:
yes
— MD5 is used for authentication.
no
— MD5 is not used for authentication.
USEKERBEROS=<value>
, where <value>
is one of the following:
yes
— Kerberos is used for authentication.
no
— Kerberos is not used for authentication.
USELDAPAUTH=<value>
, where <value>
is one of the following:
yes
— LDAP is used for authentication.
no
— LDAP is not used for authentication.
/etc/sysconfig/autofs
/etc/sysconfig/autofs
file defines custom options for the automatic mounting of devices. This file controls the operation of the automount daemons, which automatically mount file systems when you use them and unmount them after a period of inactivity. File systems can include network file systems, CD-ROMs, diskettes, and other media.
/etc/sysconfig/autofs
file may contain the following:
LOCALOPTIONS="<value>
"
, where <value>
is a string for defining machine-specific automount rules. The default value is an empty string (""
).
DAEMONOPTIONS="<value>
"
, where <value>
is the timeout length in seconds before unmounting the device. The default value is 60 seconds ("--timeout=60"
).
UNDERSCORETODOT=<value>
, where <value>
is a binary value that controls whether to convert underscores in file names into dots. For example, auto_home
to auto.home
and auto_mnt
to auto.mnt
. The default value is 1 (true).
DISABLE_DIRECT=<value>
, where <value>
is a binary value that controls whether to disable direct mount support, as the Linux implementation does not conform to the Sun Microsystems' automounter behavior. The default value is 1 (true), and allows for compatibility with the Sun automounter options specification syntax.
/etc/sysconfig/clock
/etc/sysconfig/clock
file controls the interpretation of values read from the system hardware clock.
UTC=<value>
, where <value>
is one of the following boolean values:
true
or yes
— The hardware clock is set to Universal Time.
false
or no
— The hardware clock is set to local time.
ARC=<value>
, where <value>
is the following:
false
or no
— This value indicates that the normal UNIX epoch is in use. Other values are used by systems not supported by Red Hat Enterprise Linux.
SRM=<value>
, where <value>
is the following:
false
or no
— This value indicates that the normal UNIX epoch is in use. Other values are used by systems not supported by Red Hat Enterprise Linux.
ZONE=<filename>
— The time zone file under /usr/share/zoneinfo
that /etc/localtime
is a copy of. The file contains information such as:
ZONE="America/New York"
system-config-date
)로 ZONE
파라미터를 읽을 수 있으며, 수동으로 ZONE
파라미터를 수정하여 시스템 시간 영역을 변경할 수 없습니다.
CLOCKMODE=<value>
, where <value>
is one of the following:
GMT
— The clock is set to Universal Time (Greenwich Mean Time).
ARC
— The ARC console's 42-year time offset is in effect (for Alpha-based systems only).
/etc/sysconfig/desktop
/etc/sysconfig/desktop
file specifies the desktop for new users and the display manager to run when entering runlevel 5.
DESKTOP="<value>
"
, where "<value>
"
is one of the following:
GNOME
— Selects the GNOME desktop environment.
KDE
— Selects the KDE desktop environment.
DISPLAYMANAGER="<value>
"
, where "<value>
"
is one of the following:
GNOME
— Selects the GNOME Display Manager.
KDE
— Selects the KDE Display Manager.
XDM
— Selects the X Display Manager.
/etc/sysconfig/dhcpd
/etc/sysconfig/dhcpd
file is used to pass arguments to the dhcpd
daemon at boot time. The dhcpd
daemon implements the Dynamic Host Configuration Protocol (DHCP) and the Internet Bootstrap Protocol (BOOTP). DHCP and BOOTP assign hostnames to machines on the network. For more information about what parameters are available in this file, refer to the dhcpd
man page.
/etc/sysconfig/exim
/etc/sysconfig/exim
file allows messages to be sent to one or more clients, routing the messages over whatever networks are necessary. The file sets the default values for exim to run. Its default values are set to run as a background daemon and to check its queue each hour in case something has backed up.
DAEMON=<value>
, where <value>
is one of the following:
yes
— exim
should be configured to listen to port 25 for incoming mail. yes
implies the use of the Exim's -bd
options.
no
— exim
should not be configured to listen to port 25 for incoming mail.
QUEUE=1h
which is given to exim
as -q$QUEUE
. The -q
option is not given to exim
if /etc/sysconfig/exim
exists and QUEUE
is empty or undefined.
/etc/sysconfig/firstboot
/sbin/init
program calls the etc/rc.d/init.d/firstboot
script, which in turn launches the Setup Agent. This application allows the user to install the latest updates as well as additional applications and documentation.
/etc/sysconfig/firstboot
file tells the Setup Agent application not to run on subsequent reboots. To run it the next time the system boots, remove /etc/sysconfig/firstboot
and execute chkconfig --level 5 firstboot on
.
/etc/sysconfig/gpm
/etc/sysconfig/gpm
file is used to pass arguments to the gpm
daemon at boot time. The gpm
daemon is the mouse server which allows mouse acceleration and middle-click pasting. For more information about what parameters are available for this file, refer to the gpm
man page. By default, the DEVICE
directive is set to /dev/input/mice
.
/etc/sysconfig/hwconf
/etc/sysconfig/hwconf
file lists all the hardware that kudzu
detected on the system, as well as the drivers used, vendor ID, and device ID information. The kudzu
program detects and configures new and/or changed hardware on a system. The /etc/sysconfig/hwconf
file is not meant to be manually edited. If edited, devices could suddenly show up as being added or removed.
/etc/sysconfig/i18n
/etc/sysconfig/i18n
file sets the default language, any supported languages, and the default system font. For example:
LANG="en_US.UTF-8" SUPPORTED="en_US.UTF-8:en_US:en" SYSFONT="latarcyrheb-sun16"
/etc/sysconfig/init
/etc/sysconfig/init
file controls how the system appears and functions during the boot process.
BOOTUP=<value>
, where <value>
is one of the following:
color
— The standard color boot display, where the success or failure of devices and services starting up is shown in different colors.
verbose
— An old style display which provides more information than purely a message of success or failure.
RES_COL=<value>
, where <value>
is the number of the column of the screen to start status labels. The default is set to 60.
MOVE_TO_COL=<value>
, where <value>
moves the cursor to the value in the RES_COL
line via the echo -en
command.
SETCOLOR_SUCCESS=<value>
, where <value>
sets the success color via the echo -en
command. The default color is set to green.
SETCOLOR_FAILURE=<value>
, where <value>
sets the failure color via the echo -en
command. The default color is set to red.
SETCOLOR_WARNING=<value>
, where <value>
sets the warning color via the echo -en
command. The default color is set to yellow.
SETCOLOR_NORMAL=<value>
, where <value>
resets the color to "normal" via the echo -en
.
LOGLEVEL=<value>
, where <value>
sets the initial console logging level for the kernel. The default is 3; 8 means everything (including debugging), while 1 means only kernel panics. The syslogd
daemon overrides this setting once started.
PROMPT=<value>
, where <value>
is one of the following boolean values:
yes
— Enables the key check for interactive mode.
no
— Disables the key check for interactive mode.
/etc/sysconfig/ip6tables-config
/etc/sysconfig/ip6tables-config
file stores information used by the kernel to set up IPv6 packet filtering at boot time or whenever the ip6tables
service is started.
ip6tables
rules. Rules also can be created manually using the /sbin/ip6tables
command. Once created, add the rules to the /etc/sysconfig/ip6tables
file by typing the following command:
service ip6tables save
ip6tables
, refer to 46.9절. “IPTables”.
/etc/sysconfig/iptables-config
/etc/sysconfig/iptables-config
file stores information used by the kernel to set up packet filtering services at boot time or whenever the service is started.
iptables
rules. The easiest way to add rules is to use the Security Level Configuration Tool (system-config-securitylevel
) application to create a firewall. These applications automatically edit this file at the end of the process.
/sbin/iptables
command. Once created, add the rule(s) to the /etc/sysconfig/iptables
file by typing the following command:
service iptables save
iptables
, refer to 46.9절. “IPTables”.
/etc/sysconfig/irda
/etc/sysconfig/irda
file controls how infrared devices on the system are configured at startup.
IRDA=<value>
, where <value>
is one of the following boolean values:
yes
— irattach
runs and periodically checks to see if anything is trying to connect to the infrared port, such as another notebook computer trying to make a network connection. For infrared devices to work on the system, this line must be set to yes
.
no
— irattach
does not run, preventing infrared device communication.
DEVICE=<value>
, where <value>
is the device (usually a serial port) that handles infrared connections. A sample serial device entry could be /dev/ttyS2
.
DONGLE=<value>
, where <value>
specifies the type of dongle being used for infrared communication. This setting exists for people who use serial dongles rather than real infrared ports. A dongle is a device that is attached to a traditional serial port to communicate via infrared. This line is commented out by default because notebooks with real infrared ports are far more common than computers with add-on dongles. A sample dongle entry could be actisys+
.
DISCOVERY=<value>
, where <value>
is one of the following boolean values:
yes
— Starts irattach
in discovery mode, meaning it actively checks for other infrared devices. This must be turned on for the machine to actively look for an infrared connection (meaning the peer that does not initiate the connection).
no
— Does not start irattach
in discovery mode.
/etc/sysconfig/keyboard
/etc/sysconfig/keyboard
file controls the behavior of the keyboard. The following values may be used:
KEYBOARDTYPE="sun|pc"
where sun
means a Sun keyboard is attached on /dev/kbd
, or pc
means a PS/2 keyboard connected to a PS/2 port.
KEYTABLE="<file>
"
, where <file>
is the name of a keytable file.
KEYTABLE="us"
. The files that can be used as keytables start in /lib/kbd/keymaps/i386
and branch into different keyboard layouts from there, all labeled <file>
.kmap.gz
. The first file found beneath /lib/kbd/keymaps/i386
that matches the KEYTABLE
setting is used.
/etc/sysconfig/kudzu
/etc/sysconfig/kuzdu
file triggers a safe probe of the system hardware by kudzu
at boot time. A safe probe is one that disables serial port probing.
SAFE=<value>
, where <value>
is one of the following:
yes
— kuzdu
does a safe probe.
no
— kuzdu
does a normal probe.
/etc/sysconfig/named
/etc/sysconfig/named
file is used to pass arguments to the named
daemon at boot time. The named
daemon is a Domain Name System (DNS) server which implements the Berkeley Internet Name Domain (BIND) version 9 distribution. This server maintains a table of which hostnames are associated with IP addresses on the network.
ROOTDIR="</some/where>"
, where </some/where>
refers to the full directory path of a configured chroot environment under which named
runs. This chroot environment must first be configured. Type info chroot
for more information.
OPTIONS="<value>"
, where <value>
is any option listed in the man page for named
except -t
. In place of -t
, use the ROOTDIR
line above.
named
man page. For detailed information on how to configure a BIND DNS server, refer to 18장. Berkeley Internet Name Domain (BIND). By default, the file contains no parameters.
/etc/sysconfig/network
/etc/sysconfig/network
file is used to specify information about the desired network configuration. The following values may be used:
NETWORKING=<value>
, where <value>
is one of the following boolean values:
yes
— Networking should be configured.
no
— Networking should not be configured.
HOSTNAME=<value>
, where <value>
should be the Fully Qualified Domain Name (FQDN), such as hostname.expample.com
, but can be whatever hostname is necessary.
GATEWAY=<value>
, where <value>
is the IP address of the network's gateway.
GATEWAYDEV=<value>
, where <value>
is the gateway device, such as eth0
. Configure this option if you have multiple interfaces on the same subnet, and require one of those interfaces to be the preferred route to the default gateway.
NISDOMAIN=<value>
, where <value>
is the NIS domain name.
NOZEROCONF=<value>
, where setting <value>
to true
disables the zeroconf route.
/etc/sysconfig/nfs
/etc/sysconfig/nfs
file to control which ports the required RPC services run on.
/etc/sysconfig/nfs
may not exist by default on all systems. If it does not exist, create it and add the following variables (alternatively, if the file exists, un-comment and change the default entries as required):
MOUNTD_PORT=x
x
with an unused port number.
STATD_PORT=x
x
with an unused port number.
LOCKD_TCPPORT=x
x
with an unused port number.
LOCKD_UDPPORT=x
x
with an unused port number.
/var/log/messages
. Normally, NFS will fail to start if you specify a port number that is already in use. After editing /etc/sysconfig/nfs
restart the NFS service by running the service nfs restart
command. Run the rpcinfo -p
command to confirm the changes.
MOUNTD_PORT="x
"
STATD_PORT="x
"
LOCKD_TCPPORT="x
"
LOCKD_UDPPORT="x
"
/etc/sysconfig/ntpd
/etc/sysconfig/ntpd
file is used to pass arguments to the ntpd
daemon at boot time. The ntpd
daemon sets and maintains the system clock to synchronize with an Internet standard time server. It implements version 4 of the Network Time Protocol (NTP). For more information about what parameters are available for this file, use a Web browser to view the following file: /usr/share/doc/ntp-<version>
/ntpd.htm
(where <version>
is the version number of ntpd
). By default, this file sets the owner of the ntpd
process to the user ntp
.
/etc/sysconfig/radvd
/etc/sysconfig/radvd
file is used to pass arguments to the radvd
daemon at boot time. The radvd
daemon listens for router requests and sends router advertisements for the IP version 6 protocol. This service allows hosts on a network to dynamically change their default routers based on these router advertisements. For more information about available parameters for this file, refer to the radvd
man page. By default, this file sets the owner of the radvd
process to the user radvd
.
/etc/sysconfig/samba
/etc/sysconfig/samba
file is used to pass arguments to the smbd
and the nmbd
daemons at boot time. The smbd
daemon offers file sharing connectivity for Windows clients on the network. The nmbd
daemon offers NetBIOS over IP naming services. For more information about what parameters are available for this file, refer to the smbd
man page. By default, this file sets smbd
and nmbd
to run in daemon mode.
/etc/sysconfig/selinux
/etc/sysconfig/selinux
file contains the basic configuration options for SELinux. This file is a symbolic link to /etc/selinux/config
.
/etc/sysconfig/sendmail
/etc/sysconfig/sendmail
file allows messages to be sent to one or more clients, routing the messages over whatever networks are necessary. The file sets the default values for the Sendmail application to run. Its default values are set to run as a background daemon and to check its queue each hour in case something has backed up.
DAEMON=<value>
, where <value>
is one of the following:
yes
— Sendmail should be configured to listen to port 25 for incoming mail. yes
implies the use of Sendmail's -bd
options.
no
— Sendmail should not be configured to listen to port 25 for incoming mail.
QUEUE=1h
which is given to Sendmail as -q$QUEUE
. The -q
option is not given to Sendmail if /etc/sysconfig/sendmail
exists and QUEUE
is empty or undefined.
/etc/sysconfig/spamassassin
/etc/sysconfig/spamassassin
file is used to pass arguments to the spamd
daemon (a daemonized version of Spamassassin) at boot time. Spamassassin is an email spam filter application. For a list of available options, refer to the spamd
man page. By default, it configures spamd
to run in daemon mode, create user preferences, and auto-create whitelists (allowed bulk senders).
/etc/sysconfig/squid
/etc/sysconfig/squid
file is used to pass arguments to the squid
daemon at boot time. The squid
daemon is a proxy caching server for Web client applications. For more information on configuring a squid
proxy server, use a Web browser to open the /usr/share/doc/squid-<version>
/
directory (replace <version>
with the squid
version number installed on the system). By default, this file sets squid
to start in daemon mode and sets the amount of time before it shuts itself down.
/etc/sysconfig/system-config-securitylevel
/etc/sysconfig/system-config-securitylevel
file contains all options chosen by the user the last time the Security Level Configuration Tool (system-config-securitylevel
) was run. Users should not modify this file by hand. For more information about the Security Level Configuration Tool, refer to 46.8.2절. “Basic Firewall Configuration”.
/etc/sysconfig/system-config-selinux
/etc/sysconfig/system-config-selinux
file contains all options chosen by the user the last time the SELinux Administration Tool (system-config-selinux
) was run. Users should not modify this file by hand. For more information about the SELinux Administration Tool and SELinux in general, refer to 47.2절. “Introduction to SELinux”.
/etc/sysconfig/system-config-users
/etc/sysconfig/system-config-users
file is the configuration file for the graphical application, User Manager. This file is used to filter out system users such as root
, daemon
, or lp
. This file is edited by the > pull-down menu in the User Manager application and should never be edited by hand. For more information on using this application, refer to 35.1절. “사용자와 그룹 설정”.
/etc/sysconfig/system-logviewer
/etc/sysconfig/system-logviewer
file is the configuration file for the graphical, interactive log viewing application, Log Viewer. This file is edited by the > pull-down menu in the Log Viewer application and should not be edited by hand. For more information on using this application, refer to 38장. 로그 파일.
/etc/sysconfig/tux
/etc/sysconfig/tux
file is the configuration file for the Red Hat Content Accelerator (formerly known as TUX), the kernel-based Web server. For more information on configuring the Red Hat Content Accelerator, use a Web browser to open the /usr/share/doc/tux-<version>
/tux/index.html
file (replace <version>
with the version number of TUX installed on the system). The parameters available for this file are listed in /usr/share/doc/tux-<version>
/tux/parameters.html
.
/etc/sysconfig/vncservers
/etc/sysconfig/vncservers
file configures the way the Virtual Network Computing (VNC) server starts up.
VNCSERVERS=<value>
, where <value>
is set to something like "1:fred"
, to indicate that a VNC server should be started for user fred on display :1. User fred must have set a VNC password using the vncpasswd
command before attempting to connect to the remote VNC server.
/etc/sysconfig/xinetd
/etc/sysconfig/xinetd
file is used to pass arguments to the xinetd
daemon at boot time. The xinetd
daemon starts programs that provide Internet services when a request to the port for that service is received. For more information about available parameters for this file, refer to the xinetd
man page. For more information on the xinetd
service, refer to 46.5.3절. “xinetd”.
/etc/sysconfig/
Directory/etc/sysconfig/
.
apm-scripts/
/etc/sysconfig/apm-scripts/apmcontinue
which is called at the end of the script. It is also possible to control the script by editing /etc/sysconfig/apmd
.
cbq/
networking/
system-config-network
), and its contents should not be edited manually. For more information about configuring network interfaces using the Network Administration Tool, refer to 16장. 네트워크 설정.
network-scripts/
ifcfg-eth0
for the eth0
Ethernet interface.
ifup
and ifdown
.
ifup-isdn
and ifdown-isdn
.
network-scripts
directory, refer to 15장. 네트워크 인터페이스.
rhn/
/etc/sysconfig/
directory. The following source contains more comprehensive information.
/usr/share/doc/initscripts-<version-number>
/sysconfig.txt
— This file contains a more authoritative listing of the files found in the /etc/sysconfig/
directory and the configuration options available for them. The <version-number>
in the path to this file corresponds to the version of the initscripts
package installed.
system-config-date
, system-config-time
, or dateconfig
at a shell prompt (for example, in an XTerm or a GNOME terminal).
system-config-keyboard
at a shell prompt.
Xorg
binary) listens for connections from X client applications via a network or local loopback interface. The server communicates with the hardware, such as the video card, monitor, keyboard, and mouse. X client applications exist in the user-space, creating a graphical user interface (GUI) for the user and passing user requests to the X server.
/usr/
instead of /usr/X11R6
. The /etc/X11/
directory contains configuration files for X client and server applications. This includes configuration files for the X server itself, the xfs
font server, the X display managers, and many other base components.
/etc/fonts/fonts.conf
. For more on configuring and adding fonts, refer to 33.4절. “Fonts”.
system-config-display
), particularly for devices that are not detected manually.
/etc/X11/xorg.conf
. For information about the structure of this file, refer to 33.3절. “X 서버 구성 파일”.
kwin
metacity
metacity
패키지를 실행해야 합니다.
mwm
mwm
)는 기본 독립형 창 관리자입니다. 독립형 창 관리자로 작동하도록 설계되었기 때문에 GNOME 또는 KDE와 같이 사용될 수 없습니다. Motif 창 관리자 창 관리자를 실행하려면 openmotif
패키지를 설치해야 합니다.
twm
twm
는 다른 창 관리자의 가장 기본적인 도구 모음을 제공하는 창 관리자로서 독립형과 데스크톱 환경 모두에서 사용될 수 있습니다. Tab 창 관리자는 X11R7.1 배포판의 일부분으로 설치됩니다.
xinit -e <path-to-window-manager>
at the prompt.
<path-to-window-manager>
is the location of the window manager binary file. The binary file can be located by typing which window-manager-name
, where window-manager-name
is the name of the window manager you want to run.
~]#which twm
/usr/bin/twm ~]#xinit -e /usr/bin/twm
twm
창 관리자에 대한 절대 경로를 표시하며, 두 번째 명령어는 twm
을 실행합니다.
startx
를 입력하여 런레벨 5로 돌아올 수 있습니다.
/usr/bin/Xorg
)입니다. 관련 구성 파일은 /etc/X11/
디렉토리(심볼릭 링크 — X — 는 /usr/bin/Xorg
를 가리킴)에 저장됩니다. X 서버에 필요한 구성 파일은 /etc/X11/xorg.conf
입니다.
/usr/lib/xorg/modules/
디렉토리는 실시간으로 자동 로드되는 X 서버 모듈을 포함하고 있습니다. 디폴트로 /usr/lib/xorg/modules/
디렉토리의 일부 모듈만이 X 서버에 의해 자동으로 로드됩니다.
/etc/X11/xorg.conf
. For more information about loading modules, refer to 33.3.1.5절. “Module
”.
xorg.conf
/etc/X11/xorg.conf
file, it is useful to understand the various sections and optional parameters available, especially when troubleshooting.
/etc/X11/xorg.conf
file is comprised of many different sections which address specific aspects of the system hardware.
Section "<section-name>
"
line (where <section-name>
is the title for the section) and ends with an EndSection
line. Each section contains lines that include option names and one or more option values. These are sometimes enclosed in double quotes ("
).
#
) are not read by the X server and are used for human-readable comments.
/etc/X11/xorg.conf
file accept a boolean switch which turns the feature on or off. Acceptable boolean values are:
1
, on
, true
, or yes
— Turns the option on.
0
, off
, false
, or no
— Turns the option off.
/etc/X11/xorg.conf
file. More detailed information about the X server configuration file can be found in the xorg.conf
man page.
ServerFlags
ServerFlags
section contains miscellaneous global X server settings. Any settings in this section may be overridden by options placed in the ServerLayout
section (refer to 33.3.1.3절. “ServerLayout
” for details).
ServerFlags
section is on its own line and begins with the term Option
followed by an option enclosed in double quotation marks ("
).
ServerFlags
section:
Section "ServerFlags" Option "DontZap" "true" EndSection
"DontZap" "<boolean>
"
— When the value of <boolean>
is set to true, this setting prevents the use of the Ctrl+Alt+Backspace key combination to immediately terminate the X server.
"DontZoom" "<boolean>
"
— When the value of <boolean>
is set to true, this setting prevents cycling through configured video resolutions using the Ctrl+Alt+Keypad-Plus and Ctrl+Alt+Keypad-Minus key combinations.
ServerLayout
ServerLayout
section binds together the input and output devices controlled by the X server. At a minimum, this section must specify one output device and one input device. By default, a monitor (output device) and keyboard (input device) are specified.
ServerLayout
section:
Section "ServerLayout" Identifier "Default Layout" Screen 0 "Screen0" 0 0 InputDevice "Mouse0" "CorePointer" InputDevice "Keyboard0" "CoreKeyboard" EndSection
ServerLayout
section:
Identifier
— Specifies a unique name for this ServerLayout
section.
Screen
— Specifies the name of a Screen
section to be used with the X server. More than one Screen
option may be present.
Screen
entry:
Screen 0 "Screen0" 0 0
Screen
entry (0
) indicates that the first monitor connector or head on the video card uses the configuration specified in the Screen
section with the identifier "Screen0"
.
Screen
entry with a different number and a different Screen
section identifier is necessary .
"Screen0"
give the absolute X and Y coordinates for the upper-left corner of the screen (0 0
by default).
InputDevice
— Specifies the name of an InputDevice
section to be used with the X server.
InputDevice
entries: one for the default mouse and one for the default keyboard. The options CorePointer
and CoreKeyboard
indicate that these are the primary mouse and keyboard.
Option "<option-name>
"
— An optional entry which specifies extra parameters for the section. Any options listed here override those listed in the ServerFlags
section.
<option-name>
with a valid option listed for this section in the xorg.conf
man page.
/etc/X11/xorg.conf
파일에 하나 이상의 ServerLayout
섹션을 설정하는 것이 가능하지만, 서버는 디폴트로 첫 번째 설정된 섹션만을 읽게 됩니다.
ServerLayout
섹션이 있는 경우, X 세션을 시작할 때 명령 행 인수로 지정할 수 있습니다.
Files
Files
section sets paths for services vital to the X server, such as the font path. This is an optional section, these paths are normally detected automatically. This section may be used to override any automatically detected defaults.
Files
section:
Section "Files" RgbPath "/usr/share/X11/rgb.txt" FontPath "unix/:7100" EndSection
Files
section:
RgbPath
— Specifies the location of the RGB color database. This database defines all valid color names in X and ties them to specific RGB values.
FontPath
— Specifies where the X server must connect to obtain fonts from the xfs
font server.
FontPath
is unix/:7100
. This tells the X server to obtain font information using UNIX-domain sockets for inter-process communication (IPC) on port 7100.
ModulePath
— An optional parameter which specifies alternate directories which store X server modules.
Module
/usr/lib/xorg/modules/
디렉토리에서 다음 모듈을 로드합니다:
extmod
dbe
glx
freetype
type1
record
dri
ModulePath
parameter in the Files
section. Refer to 33.3.1.4절. “Files
” for more information on this section.
/etc/X11/xorg.conf
파일에 Module
섹션을 추가하면 X 서버가 디폴트 모듈 대신 Module
섹션에 기재된 모듈을 로드하도록 설정됩니다.
Module
section:
Section "Module" Load "fbdevhw" EndSectioninstructs the X server to load the
fbdevhw
instead of the default modules.
/etc/X11/xorg.conf
파일에 Module
섹션을 추가하면 로드하려는 모든 디폴트 모듈은 물론 모든 추가 모듈을 지정해야 합니다.
InputDevice
InputDevice
section configures one input device for the X server. Systems typically have at least one InputDevice
section for the keyboard. It is perfectly normal to have no entry for a mouse, as most mouse settings are automatically detected.
InputDevice
section for a keyboard:
Section "InputDevice" Identifier "Keyboard0" Driver "kbd" Option "XkbModel" "pc105" Option "XkbLayout" "us" EndSection
InputDevice
section:
Identifier
— Specifies a unique name for this InputDevice
section. This is a required entry.
Driver
— Specifies the name of the device driver X must load for the device.
Option
— Specifies necessary options pertaining to the device.
xorg.conf
파일에 마우스를 추가할 때 주로 다음 옵션을 사용합니다:
Protocol
— Specifies the protocol used by the mouse, such as IMPS/2
.
Device
— Specifies the location of the physical device.
Emulate3Buttons
— Specifies whether to allow a two-button mouse to act like a three-button mouse when both mouse buttons are pressed simultaneously.
xorg.conf
man page for a list of valid options for this section.
Monitor
Monitor
section configures one type of monitor used by the system. This is an optional entry as well, as most monitors are now automatically detected.
Monitor
section for a monitor:
Section "Monitor" Identifier "Monitor0" VendorName "Monitor Vendor" ModelName "DDC Probed Monitor - ViewSonic G773-2" DisplaySize 320 240 HorizSync 30.0 - 70.0 VertRefresh 50.0 - 180.0 EndSection
Monitor
section of /etc/X11/xorg.conf
. Inappropriate values can damage or destroy a monitor. Consult the monitor's documentation for a listing of safe operating parameters.
Monitor
section:
Identifier
— Specifies a unique name for this Monitor
section. This is a required entry.
VendorName
— An optional parameter which specifies the vendor of the monitor.
ModelName
— An optional parameter which specifies the monitor's model name.
DisplaySize
— An optional parameter which specifies, in millimeters, the physical size of the monitor's picture area.
HorizSync
— Specifies the range of horizontal sync frequencies compatible with the monitor in kHz. These values help the X server determine the validity of built-in or specified Modeline
entries for the monitor.
VertRefresh
— Specifies the range of vertical refresh frequencies supported by the monitor, in kHz. These values help the X server determine the validity of built in or specified Modeline
entries for the monitor.
Modeline
— An optional parameter which specifies additional video modes for the monitor at particular resolutions, with certain horizontal sync and vertical refresh resolutions. Refer to the xorg.conf
man page for a more detailed explanation of Modeline
entries.
Option "<option-name>
"
— An optional entry which specifies extra parameters for the section. Replace <option-name>
with a valid option listed for this section in the xorg.conf
man page.
Device
Device
section configures one video card on the system. While one Device
section is the minimum, additional instances may occur for each video card installed on the machine.
Device
section for a video card:
Section "Device" Identifier "Videocard0" Driver "mga" VendorName "Videocard vendor" BoardName "Matrox Millennium G200" VideoRam 8192 Option "dpms" EndSection
Device
section:
Identifier
— Specifies a unique name for this Device
section. This is a required entry.
Driver
— Specifies which driver the X server must load to utilize the video card. A list of drivers can be found in /usr/share/hwdata/videodrivers
, which is installed with the hwdata
package.
VendorName
— An optional parameter which specifies the vendor of the video card.
BoardName
— An optional parameter which specifies the name of the video card.
VideoRam
— An optional parameter which specifies the amount of RAM available on the video card in kilobytes. This setting is only necessary for video cards the X server cannot probe to detect the amount of video RAM.
BusID
— An entry which specifies the bus location of the video card. On systems with only one video card a BusID
entry is optional and may not even be present in the default /etc/X11/xorg.conf
file. On systems with more than one video card, however, a BusID
entry must be present.
Screen
— An optional entry which specifies which monitor connector or head on the video card the Device
section configures. This option is only useful for video cards with multiple heads.
Device
sections must exist and each of these sections must have a different Screen
value.
Screen
entry must be an integer. The first head on the video card has a value of 0
. The value for each additional head increments this value by one.
Option "<option-name>
"
— An optional entry which specifies extra parameters for the section. Replace <option-name>
with a valid option listed for this section in the xorg.conf
man page.
"dpms"
(for Display Power Management Signaling, a VESA standard), which activates the Service Star energy compliance setting for the monitor.
Screen
Screen
section binds one video card (or video card head) to one monitor by referencing the Device
section and the Monitor
section for each. While one Screen
section is the minimum, additional instances may occur for each video card and monitor combination present on the machine.
Screen
section:
Section "Screen" Identifier "Screen0" Device "Videocard0" Monitor "Monitor0" DefaultDepth 16 SubSection "Display" Depth 24 Modes "1280x1024" "1280x960" "1152x864" "1024x768" "800x600" "640x480" EndSubSection SubSection "Display" Depth 16 Modes "1152x864" "1024x768" "800x600" "640x480" EndSubSection EndSection
Screen
section:
Identifier
— Specifies a unique name for this Screen
section. This is a required entry.
Device
— Specifies the unique name of a Device
section. This is a required entry.
Monitor
— Specifies the unique name of a Monitor
section. This is only required if a specific Monitor
section is defined in the xorg.conf
file. Normally, monitors are automatically detected.
DefaultDepth
— Specifies the default color depth in bits. In the previous example, 16
(which provides thousands of colors) is the default. Only one DefaultDepth
is permitted, although this can be overridden with the Xorg command line option -depth <n>
,where <n>
is any additional depth specified.
SubSection "Display"
— Specifies the screen modes available at a particular color depth. The Screen
section can have multiple Display
subsections, which are entirely optional since screen modes are automatically detected.
Option "<option-name>
"
— An optional entry which specifies extra parameters for the section. Replace <option-name>
with a valid option listed for this section in the xorg.conf
man page.
DRI
DRI
section specifies parameters for the Direct Rendering Infrastructure (DRI). DRI is an interface which allows 3D software applications to take advantage of 3D hardware acceleration capabilities built into most modern video hardware. In addition, DRI can improve 2D performance via hardware acceleration, if supported by the video card driver.
xorg.conf
파일에 이 섹션을 추가하여 디폴트 값을 덮어쓸 수 있습니다.
DRI
section:
Section "DRI" Group 0 Mode 0666 EndSection
xfs
.
/etc/fonts/fonts.conf
configuration file, which should not be edited by hand.
~/.gtkrc.mine
:
style "user-font" {
fontset = "<font-specification>
"
}
widget_class "*" style "user-font"
<font-specification>
with a font specification in the style used by traditional X applications, such as -adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*
. A full list of core fonts can be obtained by running xlsfonts
or created interactively using the xfontsel
command.
/usr/share/fonts/
directory. It is a good idea to create a new subdirectory, such as local/
or similar, to help distinguish between user-installed and default fonts.
.fonts/
directory in the user's home directory.
fc-cache
command to update the font information cache, as in the following example:
fc-cache <path-to-font-directory>
<path-to-font-directory>
with the directory containing the new fonts (either /usr/share/fonts/local/
or /home/<user>
/.fonts/
).
fonts:///
into the Nautilus address bar, and dragging the new font files there.
.gz
extension, it is compressed and cannot be used until uncompressed. To do this, use the gunzip
command or double-click the file and drag the font to a directory in Nautilus.
xfs
) to provide fonts to X client applications.
FontPath
directive within the Files
section of the /etc/X11/xorg.conf
configuration file. Refer to 33.3.1.4절. “Files
” for more information about the FontPath
entry.
xfs
server on a specified port to acquire font information. For this reason, the xfs
service must be running for X to start. For more about configuring services for a particular runlevel, refer to 17장. 서비스로의 접근 통제.
xfs
Configuration/etc/rc.d/init.d/xfs
script starts the xfs
server. Several options can be configured within its configuration file, /etc/X11/fs/config
.
alternate-servers
— Specifies a list of alternate font servers to be used if this font server is not available. A comma must separate each font server in a list.
catalogue
— Specifies an ordered list of font paths to use. A comma must separate each font path in a list.
:unscaled
immediately after the font path to make the unscaled fonts in that path load first. Then specify the entire path again, so that other scaled fonts are also loaded.
client-limit
— Specifies the maximum number of clients the font server services. The default is 10
.
clone-self
— Allows the font server to clone a new version of itself when the client-limit
is hit. By default, this option is on
.
default-point-size
— Specifies the default point size for any font that does not specify this value. The value for this option is set in decipoints. The default of 120
corresponds to a 12 point font.
default-resolutions
— Specifies a list of resolutions supported by the X server. Each resolution in the list must be separated by a comma.
deferglyphs
— Specifies whether to defer loading glyphs (the graphic used to visually represent a font). To disable this feature use none
, to enable this feature for all fonts use all
, or to turn this feature on only for 16-bit fonts use 16
.
error-file
— Specifies the path and file name of a location where xfs
errors are logged.
no-listen
— Prevents xfs
from listening to particular protocols. By default, this option is set to tcp
to prevent xfs
from listening on TCP ports for security reasons.
xfs
is used to serve fonts over the network, remove this line.
port
— Specifies the TCP port that xfs
listens on if no-listen
does not exist or is commented out.
use-syslog
— Specifies whether to use the system error log.
xfs
xfs
), follow these steps:
/usr/share/fonts/local/
using the following command as root:
mkdir /usr/share/fonts/local/
/usr/share/fonts/local/
directory is necessary, it must be added to the xfs
path using the following command as root:
chkfontpath --add /usr/share/fonts/local/
/usr/share/fonts/local/
directory
ttmkfdir -d /usr/share/fonts/local/ -o /usr/share/fonts/local/fonts.scale
xfs
font server configuration file by issuing the following command as root:
service xfs reload
startx
. The startx
command is a front-end to the xinit
command, which launches the X server (Xorg
) and connects X client applications to it. Because the user is already logged into the system at runlevel 3, startx
does not launch a display manager or authenticate users. Refer to 33.5.2절. “런레벨 5” for more information about display managers.
startx
command is executed, it searches for the .xinitrc
file in the user's home directory to define the desktop environment and possibly other X client applications to run. If no .xinitrc
file is present, it uses the system default /etc/X11/xinit/xinitrc
file instead.
xinitrc
script then searches for user-defined files and default system files, including .Xresources
, .Xmodmap
, and .Xkbmap
in the user's home directory, and Xresources
, Xmodmap
, and Xkbmap
in the /etc/X11/
directory. The Xmodmap
and Xkbmap
files, if they exist, are used by the xmodmap
utility to configure the keyboard. The Xresources
file is read to assign specific preference values to applications.
xinitrc
script executes all scripts located in the /etc/X11/xinit/xinitrc.d/
directory. One important script in this directory is xinput.sh
, which configures settings such as the default language.
xinitrc
script attempts to execute .Xclients
in the user's home directory and turns to /etc/X11/xinit/Xclients
if it cannot be found. The purpose of the Xclients
file is to start the desktop environment or, possibly, just a basic window manager. The .Xclients
script in the user's home directory starts the user-specified desktop environment in the .Xclients-default
file. If .Xclients
does not exist in the user's home directory, the standard /etc/X11/xinit/Xclients
script attempts to start another desktop environment, trying GNOME first and then KDE followed by twm
.
GNOME
— The default display manager for Red Hat Enterprise Linux, GNOME
allows the user to configure language settings, shutdown, restart or log in to the system.
KDE
— KDE's display manager which allows the user to shutdown, restart or log in to the system.
xdm
— A very basic display manager which only lets the user log in to the system.
prefdm
script determines the preferred display manager by referencing the /etc/sysconfig/desktop
file. A list of options for this file is available in this file:
/usr/share/doc/initscripts-<version-number>
/sysconfig.txt
<version-number>
is the version number of the initscripts
package.
/etc/X11/xdm/Xsetup_0
file to set up the login screen. Once the user logs into the system, the /etc/X11/xdm/GiveConsole
script runs to assign ownership of the console to the user. Then, the /etc/X11/xdm/Xsession
script runs to accomplish many of the tasks normally performed by the xinitrc
script when starting X from runlevel 3, including setting system and user resources, as well as running the scripts in the /etc/X11/xinit/xinitrc.d/
directory.
GNOME
or KDE
display managers by selecting it from the menu item (accessed by selecting System (on the panel) > > > ). If the desktop environment is not specified in the display manager, the /etc/X11/xdm/Xsession
script checks the .xsession
and .Xclients
files in the user's home directory to decide which desktop environment to load. As a last resort, the /etc/X11/xinit/Xclients
file is used to select a desktop environment or window manager to use in the same way as runlevel 3.
:0
) and logs out, the /etc/X11/xdm/TakeConsole
script runs and reassigns ownership of the console to the root user. The original display manager, which continues running after the user logged in, takes control by spawning a new display manager. This restarts the X server, displays a new login window, and starts the entire process over again.
/usr/share/doc/gdm-<version-number>
/README
(where <version-number>
is the version number for the gdm
package installed) and the xdm
man page.
/usr/share/X11/doc/
— contains detailed documentation on the X Window System architecture, as well as how to get additional information about the Xorg project as a new user.
man xorg.conf
— Contains information about the xorg.conf
configuration files, including the meaning and syntax for the different sections within the files.
man Xorg
— Describes the Xorg
display server.
system-config-display
at a shell prompt (for example, in an XTerm or GNOME terminal). If the X Window System is not running, a small version of X is started to run the program.
system-config-users
RPM package installed. To start the User Manager from the desktop, go to System (on the panel) > > . You can also type the command system-config-users
at a shell prompt (for example, in an XTerm or a GNOME terminal).
/bin/bash
. The default home directory is /home/<username>
/
. You can change the home directory that is created for the user, or you can choose not to create the home directory by unselecting Create home directory.
/etc/skel/
directory into the new home directory.
system-config-users
). For more information on User Manager, refer to 35.1절. “사용자와 그룹 설정”.
useradd
, usermod
, and userdel
— Industry-standard methods of adding, deleting and modifying user accounts
groupadd
, groupmod
, and groupdel
— Industry-standard methods of adding, deleting, and modifying user groups
gpasswd
— Industry-standard method of administering the /etc/group
file
pwck
, grpck
— Tools used for the verification of the password, group, and associated shadow files
pwconv
, pwunconv
— Tools used for the conversion of passwords to shadow passwords and back to standard passwords
useradd
are detailed in 표 35.1. “useradd
Command Line Options”.
useradd
Command Line Options옵션 | 내용 |
---|---|
-c '<comment> '
|
<comment> can be replaced with any string. This option is generally used to specify the full name of a user.
|
-d <home-dir>
|
Home directory to be used instead of default /home/
|
-e <date>
| 계정이 비활성화되는 날짜를 YYYY-MM-DD 형식으로 지정합니다. |
-f <days>
|
Number of days after the password expires until the account is disabled. If 0 is specified, the account is disabled immediately after the password expires. If -1 is specified, the account is not be disabled after the password expires.
|
-g <group-name>
| Group name or group number for the user's default group. The group must exist prior to being specified here. |
-G <group-list>
| 사용자가 속할 추가 그룹 이름 또는 그룹 번호를 쉼표로 구분해 써넣을 수 있습니다. 이 옵션을 사용할 때 그룹이 이미 존재해야 합니다. |
-m
| 홈 디렉토리가 존재하지 않을 때 생성합니다. |
-M
| 홈 디렉토리를 생성하지 않습니다. |
-n
| 사용자에 대한 UPG(사용자 개인 그룹)을 생성하지 않습니다. |
-r
| 홈 디렉토리가 없고 500보다 작은 UID의 시스템 계정을 생성합니다. |
-p <password>
|
The password encrypted with crypt
|
-s
|
User's login shell, which defaults to /bin/bash
|
-u <uid>
| 사용자에 대한 사용자 ID를 지정합니다. 사용자 ID는 499보다 큰 고유 숫자로 지정됩니다. |
groupadd
:
groupadd <group-name>
groupadd
are detailed in 표 35.2. “groupadd
Command Line Options”.
groupadd
Command Line Options옵션 | 내용 |
---|---|
-g <gid>
| Group ID for the group, which must be unique and greater than 499 |
-r
| Create a system group with a GID less than 500 |
-f
|
When used with -g <gid> and <gid> already exists, groupadd will choose another unique <gid> for the group.
|
chage
command with an option from 표 35.3. “chage
Command Line Options”, followed by the username.
chage
command. For more information, see 35.6절. “Shadow Passwords”.
chage
Command Line Options옵션 | 내용 |
---|---|
-m <days>
| Specifies the minimum number of days between which the user must change passwords. If the value is 0, the password does not expire. |
-M <days>
|
Specifies the maximum number of days for which the password is valid. When the number of days specified by this option plus the number of days specified with the -d option is less than the current day, the user must change passwords before using the account.
|
-d <days>
| Specifies the number of days since January 1, 1970 the password was changed |
-I <days>
| Specifies the number of inactive days after the password expiration before locking the account. If the value is 0, the account is not locked after the password expires. |
-E <date>
| Specifies the date on which the account is locked, in the format YYYY-MM-DD. Instead of the date, the number of days since January 1, 1970 can also be used. |
-W <days>
| Specifies the number of days before the password expiration date to warn the user. |
-l
| Lists current account aging settings. |
chage
command is followed directly by a username (with no options), it displays the current password aging values and allows them to be changed interactively.
python
command. It displays the following:
Python 2.4.3 (#1, Jul 21 2006, 08:46:09) [GCC 4.1.1 20060718 (Red Hat 4.1.1-9)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>
<password>
with the password to encrypt and <salt>
with a random combination of at least 2 of the following: any alphanumeric character, the slash (/) character or a dot (.):
import crypt
print crypt.crypt("
<password>
","<salt>
")
'12CsGd8FRcMSM'
.
<encrypted-password>
with the encrypted output of the Python interpreter):
usermod -p "<encrypted-password>
" <username>
usermod -p "" username
chage -d 0 username
useradd juan
is issued on a system that has shadow passwords enabled:
juan
is created in /etc/passwd
. The line has the following characteristics:
juan
.
x
for the password field indicating that the system is using shadow passwords.
juan
is set to /home/juan/
.
/bin/bash
.
juan
is created in /etc/shadow
. The line has the following characteristics:
juan
.
!!
) appear in the password field of the /etc/shadow
file, which locks the account.
-p
flag, it is placed in the /etc/shadow
file on the new line for the user.
juan
is created in /etc/group
. A group with the same name as a user is called a user private group. For more information on user private groups, refer to 35.1.1절. “새로운 사용자 추가”.
/etc/group
has the following characteristics:
juan
.
x
appears in the password field indicating that the system is using shadow group passwords.
juan
in /etc/passwd
.
juan
is created in /etc/gshadow
. The line has the following characteristics:
juan
.
!
) appears in the password field of the /etc/gshadow
file, which locks the group.
juan
is created in the /home/
directory. This directory is owned by user juan
and group juan
. However, it has read, write, and execute privileges only for the user juan
. All other permissions are denied.
/etc/skel/
directory (which contain default user settings) are copied into the new /home/juan/
directory.
juan
exists on the system. To activate it, the administrator must next assign a password to the account using the passwd
command and, optionally, set password aging guidelines.
/etc/passwd
file by an Everything installation. The groupid (GID) in this table is the primary group for the user. See 35.4절. “Standard Groups” for a listing of standard groups.
User | UID | GID | Home Directory | Shell |
---|---|---|---|---|
root | 0 | 0 |
/root
|
/bin/bash
|
bin | 1 | 1 |
/bin
|
/sbin/nologin
|
daemon | 2 | 2 |
/sbin
|
/sbin/nologin
|
adm | 3 | 4 |
/var/adm
|
/sbin/nologin
|
lp | 4 | 7 |
/var/spool/lpd
|
/sbin/nologin
|
sync | 5 | 0 |
/sbin
|
/bin/sync
|
shutdown | 6 | 0 |
/sbin
|
/sbin/shutdown
|
halt | 7 | 0 |
/sbin
|
/sbin/halt
|
8 | 12 |
/var/spool/mail
|
/sbin/nologin
| |
news | 9 | 13 |
/etc/news
| |
uucp | 10 | 14 |
/var/spool/uucp
|
/sbin/nologin
|
operator | 11 | 0 |
/root
|
/sbin/nologin
|
games | 12 | 100 |
/usr/games
|
/sbin/nologin
|
gopher | 13 | 30 |
/var/gopher
|
/sbin/nologin
|
ftp | 14 | 50 |
/var/ftp
|
/sbin/nologin
|
nobody | 99 | 99 |
/
|
/sbin/nologin
|
rpm | 37 | 37 |
/var/lib/rpm
|
/sbin/nologin
|
vcsa | 69 | 69 |
/dev
|
/sbin/nologin
|
dbus | 81 | 81 |
/
|
/sbin/nologin
|
ntp | 38 | 38 |
/etc/ntp
|
/sbin/nologin
|
canna | 39 | 39 |
/var/lib/canna
|
/sbin/nologin
|
nscd | 28 | 28 |
/
|
/sbin/nologin
|
rpc | 32 | 32 |
/
|
/sbin/nologin
|
postfix | 89 | 89 |
/var/spool/postfix
|
/sbin/nologin
|
mailman | 41 | 41 |
/var/mailman
|
/sbin/nologin
|
named | 25 | 25 |
/var/named
|
/bin/false
|
amanda | 33 | 6 |
var/lib/amanda/
|
/bin/bash
|
postgres | 26 | 26 |
/var/lib/pgsql
|
/bin/bash
|
exim | 93 | 93 |
/var/spool/exim
|
/sbin/nologin
|
sshd | 74 | 74 |
/var/empty/sshd
|
/sbin/nologin
|
rpcuser | 29 | 29 |
/var/lib/nfs
|
/sbin/nologin
|
nsfnobody | 65534 | 65534 |
/var/lib/nfs
|
/sbin/nologin
|
pvm | 24 | 24 |
/usr/share/pvm3
|
/bin/bash
|
apache | 48 | 48 |
/var/www
|
/sbin/nologin
|
xfs | 43 | 43 |
/etc/X11/fs
|
/sbin/nologin
|
gdm | 42 | 42 |
/var/gdm
|
/sbin/nologin
|
htt | 100 | 101 |
/usr/lib/im
|
/sbin/nologin
|
mysql | 27 | 27 |
/var/lib/mysql
|
/bin/bash
|
webalizer | 67 | 67 |
/var/www/usage
|
/sbin/nologin
|
mailnull | 47 | 47 |
/var/spool/mqueue
|
/sbin/nologin
|
smmsp | 51 | 51 |
/var/spool/mqueue
|
/sbin/nologin
|
squid | 23 | 23 |
/var/spool/squid
|
/sbin/nologin
|
ldap | 55 | 55 |
/var/lib/ldap
|
/bin/false
|
netdump | 34 | 34 |
/var/crash
|
/bin/bash
|
pcap | 77 | 77 |
/var/arpwatch
|
/sbin/nologin
|
radiusd | 95 | 95 |
/
|
/bin/false
|
radvd | 75 | 75 |
/
|
/sbin/nologin
|
quagga | 92 | 92 |
/var/run/quagga
|
/sbin/login
|
wnn | 49 | 49 |
/var/lib/wnn
|
/sbin/nologin
|
dovecot | 97 | 97 |
/usr/libexec/dovecot
|
/sbin/nologin
|
/etc/group
file.
Group | GID | Members |
---|---|---|
root | 0 | root |
bin | 1 | root, bin, daemon |
daemon | 2 | root, bin, daemon |
sys | 3 | root, bin, adm |
adm | 4 | root, adm, daemon |
tty | 5 | |
disk | 6 | root |
lp | 7 | daemon, lp |
mem | 8 | |
kmem | 9 | |
wheel | 10 | root |
12 | mail, postfix, exim | |
news | 13 | news |
uucp | 14 | uucp |
man | 15 | |
games | 20 | |
gopher | 30 | |
dip | 40 | |
ftp | 50 | |
lock | 54 | |
nobody | 99 | |
users | 100 | |
rpm | 37 | |
utmp | 22 | |
floppy | 19 | |
vcsa | 69 | |
dbus | 81 | |
ntp | 38 | |
canna | 39 | |
nscd | 28 | |
rpc | 32 | |
postdrop | 90 | |
postfix | 89 | |
mailman | 41 | |
exim | 93 | |
named | 25 | |
postgres | 26 | |
sshd | 74 | |
rpcuser | 29 | |
nfsnobody | 65534 | |
pvm | 24 | |
apache | 48 | |
xfs | 43 | |
gdm | 42 | |
htt | 101 | |
mysql | 27 | |
webalizer | 67 | |
mailnull | 47 | |
smmsp | 51 | |
squid | 23 | |
ldap | 55 | |
netdump | 34 | |
pcap | 77 | |
quaggavt | 102 | |
quagga | 92 | |
radvd | 75 | |
slocate | 21 | |
wnn | 49 | |
dovecot | 97 | |
radiusd | 95 |
/etc/bashrc
file. Traditionally on UNIX systems, the umask
is set to 022
, which allows only the user who created the file or directory to make modifications. Under this scheme, all other users, including members of the creator's group, are not allowed to make any modifications. However, under the UPG scheme, this "group protection" is not necessary since every user has their own private group.
/usr/share/emacs/site-lisp/
directory. Some people are trusted to modify the directory, but certainly not everyone is trusted. First create an emacs
group, as in the following command:
groupadd emacs
emacs
group, type:
chown -R root.emacs /usr/share/emacs/site-lisp
gpasswd
command:
gpasswd -a <username>
emacs
chmod 775 /usr/share/emacs/site-lisp
emacs
). Use the following command:
chmod 2775 /usr/share/emacs/site-lisp
emacs
group can create and edit files in the /usr/share/emacs/site-lisp/
directory without the administrator having to change file permissions every time users write new files.
shadow-utils
package). Doing so enhances the security of system authentication files. For this reason, the installation program enables shadow passwords by default.
/etc/passwd
file to /etc/shadow
, which is readable only by the root user.
/etc/login.defs
file to enforce security policies.
shadow-utils
package work properly whether or not shadow passwords are enabled. However, since password aging information is stored exclusively in the /etc/shadow
file, any commands which create or modify password aging information do not work.
chage
gpasswd
/usr/sbin/usermod
-e
or -f
options
/usr/sbin/useradd
-e
or -f
options
man chage
— A command to modify password aging policies and account expiration.
man gpasswd
— A command to administer the /etc/group
file.
man groupadd
— A command to add groups.
man grpck
— A command to verify the /etc/group
file.
man groupdel
— A command to remove groups.
man groupmod
— A command to modify group membership.
man pwck
— A command to verify the /etc/passwd
and /etc/shadow
files.
man pwconv
— A tool to convert standard passwords to shadow passwords.
man pwunconv
— A tool to convert shadow passwords to standard passwords.
man useradd
— A command to add users.
man userdel
— A command to remove users.
man usermod
— A command to modify users.
man 5 group
— The file containing group information for the system.
man 5 passwd
— The file containing user information for the system.
man 5 shadow
— The file containing passwords and account expiration information for the system.
system-config-printer
at a shell prompt.
computer name/printer share
. In 그림 36.5. “Adding a SMB Printer”, the computer name
is dellbox
, while the printer share
is r2
.
guest
for Windows servers, or nobody
for Samba servers.
lpq
. The last few lines look similar to the following:
lpq
outputRank Owner/ID Class Job Files Size Time active user@localhost+902 A 902 sample.txt 2050 01:20:46
lpq
and then use the command lprm job number
. For example, lprm 902
would cancel the print job in 예 36.1. “Example of lpq
output”. You must have proper permissions to cancel a print job. You can not cancel print jobs that were started by other users unless you are logged in as root on the machine to which the printer is attached.
lpr sample.txt
prints the text file sample.txt
. The print filter determines what type of file it is and converts it into a format the printer can understand.
map lpr
— The manual page for the lpr
command that allows you to print files from the command line.
man lprm
— The manual page for the command line utility to remove print jobs from the print queue.
man mpage
— The manual page for the command line utility to print multiple pages on one sheet of paper.
man cupsd
— The manual page for the CUPS printer daemon.
man cupsd.conf
— The manual page for the CUPS printer daemon configuration file.
man classes.conf
— The manual page for the class configuration file for CUPS.
locate
command is updated daily. A system administrator can use automated tasks to perform periodic backups, monitor the system, run custom scripts, and more.
cron
, at
, and batch
.
vixie-cron
RPM package must be installed and the crond
service must be running. To determine if the package is installed, use the rpm -q vixie-cron
command. To determine if the service is running, use the command /sbin/service crond status
.
/etc/crontab
, contains the following lines:
SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ # run-parts 01 * * * * root run-parts /etc/cron.hourly 02 4 * * * root run-parts /etc/cron.daily 22 4 * * 0 root run-parts /etc/cron.weekly 42 4 1 * * root run-parts /etc/cron.monthly
SHELL
variable tells the system which shell environment to use (in this example the bash shell), while the PATH
variable defines the path used to execute commands. The output of the cron tasks are emailed to the username defined with the MAILTO
variable. If the MAILTO
variable is defined as an empty string (MAILTO=""
), email is not sent. The HOME
variable can be used to set the home directory to use when executing commands or scripts.
/etc/crontab
file represents a task and has the following format:
minute hour day month dayofweek command
minute
— any integer from 0 to 59
hour
— any integer from 0 to 23
day
— any integer from 1 to 31 (must be a valid day if a month is specified)
month
— any integer from 1 to 12 (or the short name of the month such as jan or feb)
dayofweek
— any integer from 0 to 7, where 0 or 7 represents Sunday (or the short name of the week such as sun or mon)
command
— the command to execute (the command can either be a command such as ls /proc >> /tmp/proc
or the command to execute a custom script)
1-4
means the integers 1, 2, 3, and 4.
3, 4, 6, 8
indicates those four specific integers.
/<integer
>
. For example, 0-59/2
can be used to define every other minute in the minute field. Step values can also be used with an asterisk. For instance, the value */3
can be used in the month field to run the task every third month.
/etc/crontab
file, the run-parts
script executes the scripts in the /etc/cron.hourly/
, /etc/cron.daily/
, /etc/cron.weekly/
, and /etc/cron.monthly/
directories on an hourly, daily, weekly, or monthly basis respectively. The files in these directories should be shell scripts.
/etc/cron.d/
directory. All files in this directory use the same syntax as /etc/crontab
. Refer to 예 37.1. “Crontab 예시” for examples.
# record the memory usage of the system every monday # at 3:30AM in the file /tmp/meminfo 30 3 * * mon cat /proc/meminfo >> /tmp/meminfo # run custom script the first day of every month at 4:10AM 10 4 1 * * /root/scripts/backup.sh
crontab
utility. All user-defined crontabs are stored in the /var/spool/cron/
directory and are executed using the usernames of the users that created them. To create a crontab as a user, login as that user and type the command crontab -e
to edit the user's crontab using the editor specified by the VISUAL
or EDITOR
environment variable. The file uses the same format as /etc/crontab
. When the changes to the crontab are saved, the crontab is stored according to username and written to the file /var/spool/cron/username
.
/etc/crontab
file, the /etc/cron.d/
directory, and the /var/spool/cron/
directory every minute for any changes. If any changes are found, they are loaded into memory. Thus, the daemon does not need to be restarted if a crontab file is changed.
/etc/cron.allow
and /etc/cron.deny
files are used to restrict access to cron. The format of both access control files is one username on each line. Whitespace is not permitted in either file. The cron daemon (crond
) does not have to be restarted if the access control files are modified. The access control files are read each time a user tries to add or delete a cron task.
cron.allow
exists, only users listed in it are allowed to use cron, and the cron.deny
file is ignored.
cron.allow
does not exist, users listed in cron.deny
are not allowed to use cron.
/sbin/service crond start
. To stop the service, use the command /sbin/service crond stop
. It is recommended that you start the service at boot time. Refer to 17장. 서비스로의 접근 통제 for details on starting the cron service automatically at boot time.
at
command is used to schedule a one-time task at a specific time and the batch
command is used to schedule a one-time task to be executed when the systems load average drops below 0.8.
at
or batch
, the at
RPM package must be installed, and the atd
service must be running. To determine if the package is installed, use the rpm -q at
command. To determine if the service is running, use the command /sbin/service atd status
.
at time
, where time
is the time to execute the command.
time
에는 다음 중 한가지 인자를 사용할 수 있습니다:
/usr/share/doc/at-<version>
/timespec
text file.
at
command with the time argument, the at>
prompt is displayed. Type the command to execute, press Enter, and type Ctrl+D . Multiple commands can be specified by typing each command followed by the Enter key. After typing all the commands, press Enter to go to a blank line and type Ctrl+D . Alternatively, a shell script can be entered at the prompt, pressing Enter after each line in the script, and typing Ctrl+D on a blank line to exit. If a script is entered, the shell used is the shell set in the user's SHELL
environment, the user's login shell, or /bin/sh
(whichever is found first).
atq
to view pending jobs. Refer to 37.2.3절. “이후 실행할 작업 보기” for more information.
at
command can be restricted. For more information, refer to 37.2.5절. “At와 Batch로의 접근 통제하기” for details.
batch
command.
batch
command, the at>
prompt is displayed. Type the command to execute, press Enter, and type Ctrl+D . Multiple commands can be specified by typing each command followed by the Enter key. After typing all the commands, press Enter to go to a blank line and type Ctrl+D . Alternatively, a shell script can be entered at the prompt, pressing Enter after each line in the script, and typing Ctrl+D on a blank line to exit. If a script is entered, the shell used is the shell set in the user's SHELL
environment, the user's login shell, or /bin/sh
(whichever is found first). As soon as the load average is below 0.8, the set of commands or script is executed.
atq
to view pending jobs. Refer to 37.2.3절. “이후 실행할 작업 보기” for more information.
batch
command can be restricted. For more information, refer to 37.2.5절. “At와 Batch로의 접근 통제하기” for details.
at
and batch
jobs, use the atq
command. The atq
command displays a list of pending jobs, with each job on a line. Each line follows the job number, date, hour, job class, and username format. Users can only view their own jobs. If the root user executes the atq
command, all jobs for all users are displayed.
at
and batch
include:
at
and batch
Command Line Options옵션 | 설명 |
---|---|
-f
| 명령어나 쉘 스크립트를 프롬프트에서 지정하지 않고 대신 파일에서 읽어옴. |
-m
| 작업이 완료되면 사용자에게 이메일을 보냄. |
-v
| Display the time that the job is executed. |
/etc/at.allow
and /etc/at.deny
files can be used to restrict access to the at
and batch
commands. The format of both access control files is one username on each line. Whitespace is not permitted in either file. The at
daemon (atd
) does not have to be restarted if the access control files are modified. The access control files are read each time a user tries to execute the at
or batch
commands.
at
and batch
commands, regardless of the access control files.
at.allow
exists, only users listed in it are allowed to use at
or batch
, and the at.deny
file is ignored.
at.allow
does not exist, users listed in at.deny
are not allowed to use at
or batch
.
at
service, use the command /sbin/service atd start
. To stop the service, use the command /sbin/service atd stop
. It is recommended that you start the service at boot time. Refer to 17장. 서비스로의 접근 통제 for details on starting the cron service automatically at boot time.
cron
man page — overview of cron.
crontab
man pages in sections 1 and 5 — The man page in section 1 contains an overview of the crontab
file. The man page in section 5 contains the format for the file and some example entries.
/usr/share/doc/at-<version>
/timespec
contains more detailed information about the times that can be specified for cron jobs.
at
man page — description of at
and batch
and their command line options.
syslogd
. A list of log messages maintained by syslogd
can be found in the /etc/syslog.conf
configuration file.
/var/log/
directory. Some applications such as httpd
and samba
have a directory within /var/log/
for their log files.
logrotate
package contains a cron task that automatically rotates log files according to the /etc/logrotate.conf
configuration file and the configuration files in the /etc/logrotate.d/
directory. By default, it is configured to rotate every week and keep four weeks worth of previous log files.
Vi
or Emacs. Some log files are readable by all users on the system; however, root privileges are required to read most log files.
gnome-system-log
at a shell prompt.
stap
.
stapprobes
man page for details. All these events are named using a unified syntax that looks like dot-separated parameterized identifiers:
Event | Description |
---|---|
begin
| The startup of the systemtap session. |
end
| The end of the systemtap session. |
kernel.function("sys_open")
| The entry to the function named sys_open in the kernel. |
syscall.close.return
| The return from the close system call.. |
module("ext3").statement(0xdeadbeef)
| The addressed instruction in the ext3 filesystem driver. |
timer.ms(200)
| A timer that fires every 200 milliseconds. |
net/socket.c
in the kernel. The kernel.function
probe point lets you express that easily, since systemtap examines the kernel's debugging information to relate object code to source code. It works like a debugger: if you can name or place it, you can probe it. Use kernel.function("*@net/socket.c")
for the function entries, and kernel.function("*@net/socket.c").return
for the exits. Note the use of wildcards in the function name part, and the subsequent @FILENAME
part. You can also put wildcards into the file name, and even add a colon (:) and a line number, if you want to restrict the search that precisely. Since systemtap will put a separate probe in every place that matches a probe point, a few wildcards can expand to hundreds or thousands of probes, so be careful what you ask for.
probe
keyword introduces a probe point, or a comma-separated list of them. The following { and } braces enclose the handler for all listed probe points.
stap -v FILE
. Terminate it any time with ^C
. (The -v
option tells systemtap to print more verbose messages during its processing. Try the -h
option to see more options.)
ps ax
command displays a list of current system processes, including processes owned by other users. To display the owner alongside each process, use the ps aux
command. This list is a static list; in other words, it is a snapshot of what was running when you invoked the command. If you want a constantly updated list of running processes, use top
as described below.
ps
output can be long. To prevent it from scrolling off the screen, you can pipe it through less:
ps aux | less
ps
command in combination with the grep
command to see if a process is running. For example, to determine if Emacs is running, use the following command:
ps ax | grep emacs
top
command displays currently running processes and important information about them including their memory and CPU usage. The list is both real-time and interactive. An example of output from the top
command is provided as follows:
top - 15:02:46 up 35 min, 4 users, load average: 0.17, 0.65, 1.00 Tasks: 110 total, 1 running, 107 sleeping, 0 stopped, 2 zombie Cpu(s): 41.1% us, 2.0% sy, 0.0% ni, 56.6% id, 0.0% wa, 0.3% hi, 0.0% si Mem: 775024k total, 772028k used, 2996k free, 68468k buffers Swap: 1048568k total, 176k used, 1048392k free, 441172k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 4624 root 15 0 40192 18m 7228 S 28.4 2.4 1:23.21 X 4926 mhideo 15 0 55564 33m 9784 S 13.5 4.4 0:25.96 gnome-terminal 6475 mhideo 16 0 3612 968 760 R 0.7 0.1 0:00.11 top 4920 mhideo 15 0 20872 10m 7808 S 0.3 1.4 0:01.61 wnck-applet 1 root 16 0 1732 548 472 S 0.0 0.1 0:00.23 init 2 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0 3 root 5 -10 0 0 0 S 0.0 0.0 0:00.03 events/0 4 root 6 -10 0 0 0 S 0.0 0.0 0:00.02 khelper 5 root 5 -10 0 0 0 S 0.0 0.0 0:00.00 kacpid 29 root 5 -10 0 0 0 S 0.0 0.0 0:00.00 kblockd/0 47 root 16 0 0 0 0 S 0.0 0.0 0:01.74 pdflush 50 root 11 -10 0 0 0 S 0.0 0.0 0:00.00 aio/0 30 root 15 0 0 0 0 S 0.0 0.0 0:00.05 khubd 49 root 16 0 0 0 0 S 0.0 0.0 0:01.44 kswapd0
top
, press the q key.
top
commands” contains useful interactive commands that you can use with top
. For more information, refer to the top
(1) manual page.
top
commands명령어 | 설명 |
---|---|
Space | 즉시 화면을 재생합니다 |
h | 도움말 화면을 보여줍니다. |
k | 프로세스를 강제 종료 (kill) 합니다. 종료할 프로세스 ID와 보낼 신호를 입력하셔야 합니다. |
n | 보여줄 프로세스의 수를 변경합니다. 보시려는 프로세스의 수를 입력하셔야 합니다. |
u | 사용자에 따라 목록 정렬 |
M | 메모리 사용량에 따라 목록 정렬 |
P | CPU 사용량에 따라 CPU 목록 정렬 |
top
, you can use the GNOME System Monitor. To start it from the desktop, select > > or type gnome-system-monitor
at a shell prompt (such as an XTerm). Select the Process Listing tab.
free
command displays the total amount of physical memory and swap space for the system as well as the amount of memory that is used, free, shared, in kernel buffers, and cached.
total used free shared buffers cached Mem: 645712 549720 95992 0 176248 224452 -/+ buffers/cache: 149020 496692 Swap: 1310712 0 1310712
free -m
shows the same information in megabytes, which are easier to read.
total used free shared buffers cached Mem: 630 536 93 0 172 219 -/+ buffers/cache: 145 485 Swap: 1279 0 1279
free
, you can use the GNOME System Monitor. To start it from the desktop, go to > > or type gnome-system-monitor
at a shell prompt (such as an XTerm). Click on the Resources tab.
df
command reports the system's disk space usage. If you type the command df
at a shell prompt, the output looks similar to the following:
Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VolGroup00-LogVol00 11675568 6272120 4810348 57% / /dev/sda1 100691 9281 86211 10% /boot none 322856 0 322856 0% /dev/shm
df -h
. The -h
argument stands for human-readable format. The output looks similar to the following:
Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 12G 6.0G 4.6G 57% / /dev/sda1 99M 9.1M 85M 10% /boot none 316M 0 316M 0% /dev/shm
/dev/shm
. This entry represents the system's virtual memory file system.
du
command displays the estimated amount of space being used by files in a directory. If you type du
at a shell prompt, the disk usage for each of the subdirectories is displayed in a list. The grand total for the current directory and subdirectories are also shown as the last line in the list. If you do not want to see the totals for all the subdirectories, use the command du -hs
to see only the grand total for the directory in human-readable format. Use the du --help
command to see more options.
gnome-system-monitor
at a shell prompt (such as an XTerm). Select the File Systems tab to view the system's partitions. The figure below illustrates the File Systems tab.
hwbrowser
at a shell prompt. As shown in 그림 40.4. “Hardware Browser”, it displays your CD-ROM devices, diskette drives, hard drives and their partitions, network devices, pointing devices, system devices, and video cards. Click on the category name in the left menu, and the information is displayed.
hal-device-manager
. Depending on your installation preferences, the graphical menu above may start this application or the Hardware Browser when clicked. The figure below illustrates the Device Manager window.
lspci
command to list all PCI devices. Use the command lspci -v
for more verbose information or lspci -vv
for very verbose output.
lspci
can be used to determine the manufacturer, model, and memory size of a system's video card:
00:00.0 Host bridge: ServerWorks CNB20LE Host Bridge (rev 06) 00:00.1 Host bridge: ServerWorks CNB20LE Host Bridge (rev 06) 00:01.0 VGA compatible controller: S3 Inc. Savage 4 (rev 04) 00:02.0 Ethernet controller: Intel Corp. 82557/8/9 [Ethernet Pro 100] (rev 08) 00:0f.0 ISA bridge: ServerWorks OSB4 South Bridge (rev 50) 00:0f.1 IDE interface: ServerWorks OSB4 IDE Controller 00:0f.2 USB Controller: ServerWorks OSB4/CSB5 OHCI USB Controller (rev 04) 01:03.0 SCSI storage controller: Adaptec AIC-7892P U160/m (rev 02) 01:05.0 RAID bus controller: IBM ServeRAID Controller
lspci
is also useful to determine the network card in your system if you do not know the manufacturer or model number.
ps --help
— Displays a list of options that can be used with ps
.
top
manual page — Type man top
to learn more about top
and its many options.
free
manual page — type man free
to learn more about free
and its many options.
df
manual page — Type man df
to learn more about the df
command and its many options.
du
manual page — Type man du
to learn more about the du
command and its many options.
lspci
manual page — Type man lspci
to learn more about the lspci
command and its many options.
oprofile
RPM package must be installed to use this tool.
--separate=library
옵션이 사용되지 않은 한 공유 라이브러리 코드의 샘플은 특정 응용 프로그램에 속하지 않습니다.
opreport
does not associate samples for inline functions' properly — opreport
uses a simple address range mechanism to determine which function an address is in. Inline function samples are not attributed to the inline function but rather to the function the inline function was inserted into.
opcontrol --reset
to clear out the samples from previous runs.
oprofile
package.
명령 | 설명 |
---|---|
ophelp
|
Displays available events for the system's processor along with a brief description of each.
|
opimport
|
샘플 데이터베이스 파일을 외부 이진 형식에서 시스템의 원시 형식으로 변환합니다. 다른 구조에서 수집한 샘플 데이터베이스를 분석할 경우에만 이 옵션을 사용하십시오.
|
opannotate
|
Creates annotated source for an executable if the application was compiled with debugging symbols. Refer to 41.5.4절. “Using opannotate ” for details.
|
opcontrol
|
Configures what data is collected. Refer to 41.2절. “OProfile 설정” for details.
|
opreport
|
Retrieves profile data. Refer to 41.5.1절. “Using
opreport ” for details.
|
oprofiled
|
데몬으로 실행되어 샘플 데이터를 디스크에 주기적으로 기록합니다.
|
opcontrol
utility to configure OProfile. As the opcontrol
commands are executed, the setup options are saved to the /root/.oprofile/daemonrc
file.
opcontrol --setup --vmlinux=/usr/lib/debug/lib/modules/`uname -r`/vmlinux
debuginfo
package must be installed (which contains the uncompressed kernel) in order to monitor the kernel.
opcontrol --setup --no-vmlinux
oprofile
kernel module, if it is not already loaded, and creates the /dev/oprofile/
directory, if it does not already exist. Refer to 41.6절. “Understanding /dev/oprofile/
” for details about this directory.
oprofile
module can be loaded from it.
프로세서 |
cpu_type
| 카운터 수 |
---|---|---|
Pentium Pro | i386/ppro | 2 |
Pentium II | i386/pii | 2 |
Pentium III | i386/piii | 2 |
Pentium 4 (non-hyper-threaded) | i386/p4 | 8 |
Pentium 4 (hyper-threaded) | i386/p4-ht | 4 |
Athlon | i386/athlon | 4 |
AMD64 | x86-64/hammer | 4 |
Itanium | ia64/itanium | 4 |
Itanium 2 | ia64/itanium2 | 4 |
TIMER_INT | timer | 1 |
IBM eServer iSeries and pSeries | timer | 1 |
ppc64/power4 | 8 | |
ppc64/power5 | 6 | |
ppc64/970 | 8 | |
IBM eServer S/390 and S/390x | timer | 1 |
IBM eServer zSeries | timer | 1 |
timer
is used as the processor type if the processor does not have supported performance monitoring hardware.
timer
is used, events cannot be set for any processor because the hardware does not have support for hardware performance counters. Instead, the timer interrupt is used for profiling.
timer
is not used as the processor type, the events monitored can be changed, and counter 0 for the processor is set to a time-based event by default. If more than one counter exists on the processor, the counters other than counter 0 are not set to an event by default. The default events monitored are shown in 표 41.3. “기본 사건”.
프로세서 | Default Event for Counter | 설명 |
---|---|---|
Pentium Pro, Pentium II, Pentium III, Athlon, AMD64 | CPU_CLK_UNHALTED | The processor's clock is not halted |
Pentium 4 (HT and non-HT) | GLOBAL_POWER_EVENTS | 프로세서가 멈추지 않은 시간 |
Itanium 2 | CPU_CYCLES | CPU 사이클 |
TIMER_INT | (없음) | 각 타이머 인터럽트의 샘플 |
ppc64/power4 | CYCLES | Processor Cycles |
ppc64/power5 | CYCLES | Processor Cycles |
ppc64/970 | CYCLES | Processor Cycles |
ls -d /dev/oprofile/[0-9]*
ophelp
opcontrol
:
opcontrol --event=<event-name>
:<sample-rate>
<event-name>
with the exact name of the event from ophelp
, and replace <sample-rate>
with the number of events between samples.
cpu_type
is not timer
, each event can have a sampling rate set for it. The sampling rate is the number of events between each sample snapshot.
opcontrol --event=<event-name>
:<sample-rate>
<sample-rate>
with the number of events to wait before sampling again. The smaller the count, the more frequent the samples. For events that do not happen frequently, a lower count may be needed to capture the event instances.
ophelp
command. The values for each unit mask are listed in hexadecimal format. To specify more than one unit mask, the hexadecimal values must be combined using a bitwise or operation.
opcontrol --event=<event-name>
:<sample-rate>
:<unit-mask>
opcontrol --event=<event-name>
:<sample-rate>
:<unit-mask>
:0
opcontrol --event=<event-name>
:<sample-rate>
:<unit-mask>
:1
opcontrol --event=<event-name>
:<sample-rate>
:<unit-mask>
:<kernel>
:0
opcontrol --event=<event-name>
:<sample-rate>
:<unit-mask>
:<kernel>
:1
opcontrol --separate=<choice>
<choice>
can be one of the following:
none
— do not separate the profiles (default)
library
— generate per-application profiles for libraries
kernel
— generate per-application profiles for the kernel and kernel modules
all
— generate per-application profiles for libraries and per-application profiles for the kernel and kernel modules
--separate=library
옵션이 사용된다면 라이브러리의 이름을 비롯하여 실행 파일의 이름을 입력하십시오.
oprofile
is restarted.
opcontrol --start
Using log file /var/lib/oprofile/oprofiled.log Daemon started. Profiler running.
/root/.oprofile/daemonrc
are used.
oprofiled
, is started; it periodically writes the sample data to the /var/lib/oprofile/samples/
directory. The log file for the daemon is located at /var/lib/oprofile/oprofiled.log
.
opcontrol --shutdown
<name>
with a unique descriptive name for the current session.
opcontrol --save=<name>
/var/lib/oprofile/samples/name
/
is created and the current sample files are copied to it.
oprofiled
, collects the samples and writes them to the /var/lib/oprofile/samples/
directory. Before reading the data, make sure all data has been written to this directory by executing the following command as root:
opcontrol --dump
/bin/bash
becomes:
\{root\}/bin/bash/\{dep\}/\{root\}/bin/bash/CPU_CLK_UNHALTED.100000
opreport
opannotate
oparchive
can be used to address this problem.
opreport
opreport
tool provides an overview of all the executables being profiled.
Profiling through timer interrupt TIMER:0| samples| %| ------------------ 25926 97.5212 no-vmlinux 359 1.3504 pi 65 0.2445 Xorg 62 0.2332 libvte.so.4.4.0 56 0.2106 libc-2.3.4.so 34 0.1279 libglib-2.0.so.0.400.7 19 0.0715 libXft.so.2.1.2 17 0.0639 bash 8 0.0301 ld-2.3.4.so 8 0.0301 libgdk-x11-2.0.so.0.400.13 6 0.0226 libgobject-2.0.so.0.400.7 5 0.0188 oprofiled 4 0.0150 libpthread-2.3.4.so 4 0.0150 libgtk-x11-2.0.so.0.400.13 3 0.0113 libXrender.so.1.2.2 3 0.0113 du 1 0.0038 libcrypto.so.0.9.7a 1 0.0038 libpam.so.0.77 1 0.0038 libtermcap.so.2.0.8 1 0.0038 libX11.so.6.2 1 0.0038 libgthread-2.0.so.0.400.7 1 0.0038 libwnck-1.so.4.9.0
opreport
man page for a list of available command line options, such as the -r
option used to sort the output from the executable with the smallest number of samples to the one with the largest number of samples.
opreport
on a Single Executableopreport
:
opreport <mode>
<executable>
<executable>
must be the full path to the executable to be analyzed. <mode>
must be one of the following:
-l
opreport -l /lib/tls/libc-<version>
.so
:
samples % symbol name 12 21.4286 __gconv_transform_utf8_internal 5 8.9286 _int_malloc 4 7.1429 malloc 3 5.3571 __i686.get_pc_thunk.bx 3 5.3571 _dl_mcount_wrapper_check 3 5.3571 mbrtowc 3 5.3571 memcpy 2 3.5714 _int_realloc 2 3.5714 _nl_intern_locale_data 2 3.5714 free 2 3.5714 strcmp 1 1.7857 __ctype_get_mb_cur_max 1 1.7857 __unregister_atfork 1 1.7857 __write_nocancel 1 1.7857 _dl_addr 1 1.7857 _int_free 1 1.7857 _itoa_word 1 1.7857 calc_eclosure_iter 1 1.7857 fopen@@GLIBC_2.1 1 1.7857 getpid 1 1.7857 memmove 1 1.7857 msort_with_tmp 1 1.7857 strcpy 1 1.7857 strlen 1 1.7857 vfprintf 1 1.7857 write
-l
옵션에 -r
옵션을 함께 사용하시면 됩니다.
-i <symbol-name>
opreport -l -i __gconv_transform_utf8_internal /lib/tls/libc-<version>
.so
:
samples % symbol name 12 100.000 __gconv_transform_utf8_internal
-d
-l
. For example, the following output is from the command opreport -l -d __gconv_transform_utf8_internal /lib/tls/libc-<version>
.so
:
vma samples % symbol name 00a98640 12 100.000 __gconv_transform_utf8_internal 00a98640 1 8.3333 00a9868c 2 16.6667 00a9869a 1 8.3333 00a986c1 1 8.3333 00a98720 1 8.3333 00a98749 1 8.3333 00a98753 1 8.3333 00a98789 1 8.3333 00a98864 1 8.3333 00a98869 1 8.3333 00a98b08 1 8.3333
-l
옵션을 사용할 때와 동일한 데이터가 나타나지만, 사용된 가상 메모리 주소가 나타나는 차이점이 있습니다. 각 가상 메모리 주소에 대하여 샘플의 숫자와 심볼의 샘플 수에 비교한 샘플의 비율을 보여줍니다.
-x
<symbol-name>
session
:<name>
/var/lib/oprofile/samples/
directory.
~]$ opreport /ext3
CPU: AMD64 processors, speed 797.948 MHz (estimated)
Counted DATA_CACHE_ACCESSES events (Data cache accesses) with a unit mask of 0x00 (No unit mask) count 500000
Counted DATA_CACHE_MISSES events (Data cache misses) with a unit mask of 0x00 (No unit mask) count 500000
DATA_CACHE_ACC...|DATA_CACHE_MIS...|
samples| %| samples| %|
------------------------------------
148721 100.000 1493 100.000 ext3
~]# ln -s /lib/modules/`uname -r`/kernel/fs/ext3/ext3.ko /ext3
Then the detailed information can be obtained with:
~]# opreport image:/ext3 -l|more
warning: could not check that the binary file /ext3 has not been modified since the profile was taken. Results may be inaccurate.
CPU: AMD64 processors, speed 797.948 MHz (estimated)
Counted DATA_CACHE_ACCESSES events (Data cache accesses) with a unit mask of 0x00 (No unit mask) count 500000
Counted DATA_CACHE_MISSES events (Data cache misses) with a unit mask of 0x00 (No unit mask) count 500000
samples % samples % symbol name
16728 11.2479 7 0.4689 ext3_group_sparse
16454 11.0637 4 0.2679 ext3_count_free_blocks
14583 9.8056 51 3.4159 ext3_fill_super
8281 5.5681 129 8.6403 ext3_ioctl
7810 5.2514 62 4.1527 ext3_write_info
7286 4.8991 67 4.4876 ext3_ordered_writepage
6509 4.3767 130 8.7073 ext3_new_inode
6378 4.2886 156 10.4488 ext3_new_block
5932 3.9887 87 5.8272 ext3_xattr_block_list
...
opannotate
opannotate
tool tries to match the samples for particular instructions to the corresponding lines in the source code. The resulting files generated should have the samples for the lines at the left. It also puts in a comment at the beginning of each function listing the total samples for the function.
-g
option. By default, Red Hat Enterprise Linux packages are not compiled with this option.
opannotate
is as follows:
opannotate --search-dirs <src-dir>
--source <executable>
opannotate
man page for a list of additional command line options.
/dev/oprofile/
/dev/oprofile/
directory contains the file system for OProfile. Use the cat
command to display the values of the virtual files in this file system. For example, the following command displays the type of processor OProfile detected:
cat /dev/oprofile/cpu_type
/dev/oprofile/
for each counter. For example, if there are 2 counters, the directories /dev/oprofile/0/
and dev/oprofile/1/
exist.
count
— The interval between samples.
enabled
— If 0, the counter is off and no samples are collected for it; if 1, the counter is on and samples are being collected for it.
event
— The event to monitor.
kernel
— If 0, samples are not collected for this counter event when the processor is in kernel-space; if 1, samples are collected even if the processor is in kernel-space.
unit_mask
— Defines which unit masks are enabled for the counter.
user
— If 0, samples are not collected for the counter event when the processor is in user-space; if 1, samples are collected even if the processor is in user-space.
cat
command. For example:
cat /dev/oprofile/0/count
opreport
can be used to determine how much processor time an application or service uses. If the system is used for multiple services but is under performing, the services consuming the most processor time can be moved to dedicated systems.
CPU_CLK_UNHALTED
event can be monitored to determine the processor load over a given period of time. This data can then be used to determine if additional processors or a faster processor might improve system performance.
oprof_start
command as root at a shell prompt. To use the graphical interface, you will need to have the oprofile-gui
package installed.
/root/.oprofile/daemonrc
, and the application exits. Exiting the application does not stop OProfile from sampling.
oprof_start
interface
vmlinux
file for the kernel to monitor in the Kernel image file text field. To configure OProfile not to monitor the kernel, select No kernel image.
oprofiled
daemon log includes more information.
opcontrol --separate=kernel
command. If Per-application shared libs samples files is selected, OProfile generates per-application profiles for libraries. This is equivalent to the opcontrol --separate=library
command.
opcontrol --dump
command.
/usr/share/doc/oprofile-<version>
/oprofile.html
— OProfile Manual
oprofile
man page — Discusses opcontrol
, opreport
, opannotate
, and ophelp
yum
command. The Package Management Tool automatically queries the Red Hat Enterprise Linux servers and determines which packages need to be updated on your machine, including the kernel. This chapter is only useful for those individuals that require manual updating of kernel packages, without using the yum
command.
yum
is highly recommended by Red Hat for installing upgraded kernels.
yum
, refer to 14장. Product Subscriptions and Entitlements.
kernel
— Contains the kernel for multi-processor systems. For x86 system, only the first 4GB of RAM is used. As such, x86 systems with over 4GB of RAM should use the kernel-PAE
.
kernel-devel
— Contains the kernel headers and makefiles sufficient to build modules against the kernel
package.
kernel-PAE
(only for i686 systems) — This package offers the following key configuration option (in addition to the options already enabled for the kernel
package):
kernel-hugemem
package) is able to reliably address all 64GB of memory. Additionally, the Red Hat Enterprise Linux 5 PAE variant does not allow 4GB of addressable memory per-process like the Red Hat Enterprise Linux 4 kernel-hugemem
variant does. However, the x86_64 kernel does not suffer from any of these limitations, and is the suggested Red Hat Enterprise Linux 5 architecture to use with large-memory systems.
kernel-PAE-devel
— Contains the kernel headers and makefiles required to build modules against the kernel-PAE
package.
kernel-doc
— Contains documentation files from the kernel source. Various portions of the Linux kernel and the device drivers shipped with it are documented in these files. Installation of this package provides a reference to the options that can be passed to Linux kernel modules at load time.
/usr/share/doc/kernel-doc-<version>
/
directory.
kernel-headers
— Includes the C header files that specify the interface between the Linux kernel and userspace libraries and programs. The header files define structures and constants that are needed for building most standard programs.
kernel-xen
— Includes a version of the Linux kernel which is needed to run Virtualization.
kernel-xen-devel
— Contains the kernel headers and makefiles required to build modules against the kernel-xen
package
kernel-source
package has been removed and replaced with an RPM that can only be retrieved from Red Hat Network. This *.src.rpm
package must then be rebuilt locally using the rpmbuild
command. For more information on obtaining and installing the kernel source package, refer to the latest updated Release Notes (including all updates) at http://www.redhat.com/docs/manuals/enterprise/
/sbin/mkbootdisk `uname -r`
at a shell prompt.
mkbootdisk
man page for more options. You can create bootable media via CD-Rs, CD-RWs, and USB flash drives, provided that your system BIOS also supports it.
rpm -qa | grep kernel
at a shell prompt:
kernel-2.6.9-5.EL kernel-devel-2.6.9-5.EL kernel-utils-2.6.9-5.EL kernel-doc-2.6.9-5.EL kernel-smp-2.6.9-5.EL kernel-smp-devel-2.6.9-5.EL kernel-hugemem-devel-2.6.9-5.EL
kernel
package. Refer to 42.1절. “커널 패키지 개요” for descriptions of the different packages.
<variant>
-<version>
.<arch>
.rpm, where <variant>
is one of either PAE
, xen
, and so forth. The <arch>
is one of the following:
x86_64
for the AMD64 and Intel EM64T architectures
ia64
for the Intel® Itanium™ architecture
ppc64
for the IBM® eServer™ pSeries™ architecture
s390
for the IBM® S/390® architecture
s390x
for the IBM® eServer™ System z® architecture
i686
for Intel® Pentium® II, Intel® Pentium® III, Intel® Pentium® 4, AMD Athlon®, and AMD Duron® systems
-i
argument with the rpm
command to keep the old kernel. Do not use the -U
option, since it overwrites the currently installed kernel, which creates boot loader problems. For example:
rpm -ivh kernel-<kernel version>
.<arch>
.rpm
/etc/fstab
, an initial RAM disk is needed. The initial RAM disk allows a modular kernel to have access to modules that it might need to boot from before the kernel has access to the device where the modules normally reside.
mkinitrd
command. However, this step is performed automatically if the kernel and its associated packages are installed or upgraded from the RPM packages distributed by Red Hat; in such cases, you do not need to create the initial RAM disk manually. To verify that an initial RAM disk already exists, use the command ls -l /boot
to make sure the initrd-<version>
.img
file was created (the version should match the version of the kernel just installed).
vmlinux
file are combined into one file, which is created with the addRamDisk
command. This step is performed automatically if the kernel and its associated packages are installed or upgraded from the RPM packages distributed by Red Hat, Inc.; thus, it does not need to be executed manually. To verify that it was created, use the command ls -l /boot
to make sure the /boot/vmlinitrd-<kernel-version>
file already exists (the <kernel-version>
should match the version of the kernel just installed).
kernel
RPM package configures the boot loader to boot the newly installed kernel (except for IBM eServer iSeries systems). However, it does not configure the boot loader to boot the new kernel by default.
/boot/grub/grub.conf
contains a title
section with the same version as the kernel
package just installed
# Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,0) # kernel /vmlinuz-version ro root=/dev/hda2 # initrd /initrd-version.img #boot=/dev/hda default=1 timeout=10 splashimage=(hd0,0)/grub/splash.xpm.gz title Red Hat Enterprise Linux (2.6.9-5.EL) root (hd0,0) kernel /vmlinuz-2.6.9-5.EL ro root=LABEL=/ initrd /initrd-2.6.9-5.EL.img title Red Hat Enterprise Linux (2.6.9-1.906_EL) root (hd0,0) kernel /vmlinuz-2.6.9-1.906_EL ro root=LABEL=/ initrd /initrd-2.6.9-1.906_EL.img
/boot/
partition was created, the paths to the kernel and initrd
image are relative to /boot/
.
default
variable to the title section number for the title section that contains the new kernel. The count starts with 0. For example, if the new kernel is the first title section, set default
to 0
.
/boot/efi/EFI/redhat/elilo.conf
as the configuration file. Confirm that this file contains an image
section with the same version as the kernel
package just installed:
prompt timeout=50 default=old image=vmlinuz-2.6.9-5.EL label=linux initrd=initrd-2.6.9-5.EL.img read-only append="root=LABEL=/" image=vmlinuz-2.6.9-1.906_EL label=old initrd=initrd-2.6.9-1.906.img read-only append="root=LABEL=/"
default
variable to the value of the label
for the image
section that contains the new kernel.
/etc/zipl.conf
as the configuration file. Confirm that the file contains a section with the same version as the kernel package just installed:
[defaultboot] default=old target=/boot/ [linux] image=/boot/vmlinuz-2.6.9-5.EL ramdisk=/boot/initrd-2.6.9-5.EL.img parameters="root=LABEL=/" [old] image=/boot/vmlinuz-2.6.9-1.906_EL ramdisk=/boot/initrd-2.6.9-1.906_EL.img parameters="root=LABEL=/"
default
variable to the name of the section that contains the new kernel. The first line of each section contains the name in brackets.
/sbin/zipl
as root to enable the changes.
/boot/vmlinitrd-<kernel-version>
file is installed when you upgrade the kernel. However, you must use the dd
command to configure the system to boot the new kernel:
cat /proc/iSeries/mf/side
to determine the default side (either A, B, or C).
<kernel-version>
is the version of the new kernel and <side>
is the side from the previous command:
dd if=/boot/vmlinitrd-<kernel-version>
of=/proc/iSeries/mf/<side>
/vmlinux bs=8k
/etc/aboot.conf
as the configuration file. Confirm that the file contains an image
section with the same version as the kernel
package just installed:
boot=/dev/sda1 init-message=Welcome to Red Hat Enterprise Linux! Hit <TAB> for boot options partition=2 timeout=30 install=/usr/lib/yaboot/yaboot delay=10 nonvram image=/vmlinux--2.6.9-5.EL label=old read-only initrd=/initrd--2.6.9-5.EL.img append="root=LABEL=/" image=/vmlinux-2.6.9-5.EL label=linux read-only initrd=/initrd-2.6.9-5.EL.img append="root=LABEL=/"
default
and set it to the label
of the image stanza that contains the new kernel.
kernel-smp-unsupported-<kernel-version>
and kernel-hugemem-unsupported-<kernel-version>
. Replace <kernel-version>
with the version of the kernel installed on the system. These packages are not installed by the Red Hat Enterprise Linux installation program, and the modules provided are not supported by Red Hat, Inc.
module-init-tools
package is installed. Use these commands to determine if a module has been loaded successfully or when trying different modules for a piece of new hardware.
/sbin/lsmod
displays a list of currently loaded modules. For example:
Module Size Used by tun 11585 1 autofs4 21573 1 hidp 16193 2 rfcomm 37849 0 l2cap 23873 10 hidp,rfcomm bluetooth 50085 5 hidp,rfcomm,l2cap sunrpc 153725 1 dm_mirror 29073 0 dm_mod 57433 1 dm_mirror video 17221 0 sbs 16257 0 i2c_ec 5569 1 sbs container 4801 0 button 7249 0 battery 10565 0 asus_acpi 16857 0 ac 5701 0 ipv6 246113 12 lp 13065 0 parport_pc 27493 1 parport 37001 2 lp,parport_pc uhci_hcd 23885 0 floppy 57317 1 sg 34653 0 snd_ens1371 26721 1 gameport 16073 1 snd_ens1371 snd_rawmidi 24897 1 snd_ens1371 snd_ac97_codec 91360 1 snd_ens1371 snd_ac97_bus 2753 1 snd_ac97_codec snd_seq_dummy 4293 0 snd_seq_oss 32705 0 serio_raw 7493 0 snd_seq_midi_event 8001 1 snd_seq_oss snd_seq 51633 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event snd_seq_device 8781 4 snd_rawmidi,snd_seq_dummy,snd_seq_oss,snd_seq snd_pcm_oss 42849 0 snd_mixer_oss 16833 1 snd_pcm_oss snd_pcm 76485 3 snd_ens1371,snd_ac97_codec,snd_pcm_oss snd_timer 23237 2 snd_seq,snd_pcm snd 52933 12 snd_ens1371,snd_rawmidi,snd_ac97_codec,snd_seq_oss,snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer soundcore 10145 1 snd i2c_piix4 8909 0 ide_cd 38625 3 snd_page_alloc 10569 1 snd_pcm i2c_core 21697 2 i2c_ec,i2c_piix4 pcnet32 34117 0 cdrom 34913 1 ide_cd mii 5825 1 pcnet32 pcspkr 3521 0 ext3 129737 2 jbd 58473 1 ext3 mptspi 17353 3 scsi_transport_spi 25025 1 mptspi mptscsih 23361 1 mptspi sd_mod 20929 16 scsi_mod 134121 5 sg,mptspi,scsi_transport_spi,mptscsih,sd_mod mptbase 52193 2 mptspi,mptscsih
/sbin/lsmod
output is less verbose and easier to read than the output from viewing /proc/modules
.
/sbin/modprobe
command followed by the kernel module name. By default, modprobe
attempts to load the module from the /lib/modules/<kernel-version>
/kernel/drivers/
subdirectories. There is a subdirectory for each type of module, such as the net/
subdirectory for network interface drivers. Some kernel modules have module dependencies, meaning that other modules must be loaded first for it to load. The /sbin/modprobe
command checks for these dependencies and loads the module dependencies before loading the specified module.
modprobe e100
e100
module.
/sbin/modprobe
executes them, use the -v
option. For example:
modprobe -v e100
insmod /lib/modules/2.6.9-5.EL/kernel/drivers/net/e100.ko Using /lib/modules/2.6.9-5.EL/kernel/drivers/net/e100.ko Symbol version prefix 'smp_'
/sbin/insmod
command also exists to load kernel modules; however, it does not resolve dependencies. Thus, it is recommended that the /sbin/modprobe
command be used.
/sbin/rmmod
command followed by the module name. The rmmod
utility only unloads modules that are not in use and that are not a dependency of other modules in use.
rmmod e100
e100
kernel module.
modinfo
. Use the command /sbin/modinfo
to display information about a kernel module. The general syntax is:
modinfo [options]
<module>
-d
, which displays a brief description of the module, and -p
, which lists the parameters the module supports. For a complete list of options, refer to the modinfo
man page (man modinfo
).
/etc/modprobe.conf
file. However, it is sometimes necessary to explicitly force the loading of a module at boot time.
/etc/rc.modules
file at boot time, which contains various commands to load modules. The rc.modules
should be used, and not rc.local
because rc.modules
is executed earlier in the boot process.
foo
module at boot time (as root):
echo modprobe foo >> /etc/rc.modules
chmod +x /etc/rc.modules
e100
driver with the e100_speed_duplex=4
option.
modinfo
command is also useful for listing various information about a kernel module, such as version, dependencies, parameter options, and aliases.
Hardware | Module | Parameters |
---|---|---|
3ware Storage Controller and 9000 series |
3w-xxxx.ko, 3w-9xxx.ko
| |
Adaptec Advanced Raid Products, Dell PERC2, 2/Si, 3/Si, 3/Di, HP NetRAID-4M, IBM ServeRAID, and ICP SCSI driver |
aacraid.ko
|
nondasd — Control scanning of hba for nondasd devices. 0=off, 1=on
dacmode — Control whether dma addressing is using 64 bit DAC. 0=off, 1=on
commit — Control whether a COMMIT_CONFIG is issued to the adapter for foreign arrays. This is typically needed in systems that do not have a BIOS. 0=off, 1=on
startup_timeout — The duration of time in seconds to wait for adapter to have it's kernel up and running. This is typically adjusted for large systems that do not have a BIOS
aif_timeout — The duration of time in seconds to wait for applications to pick up AIFs before deregistering them. This is typically adjusted for heavily burdened systems.
numacb — Request a limit to the number of adapter control blocks (FIB) allocated. Valid values are 512 and down. Default is to use suggestion from Firmware.
acbsize — Request a specific adapter control block (FIB) size. Valid values are 512, 2048, 4096 and 8192. Default is to use suggestion from Firmware.
|
Adaptec 28xx, R9xx, 39xx AHA-284x, AHA-29xx, AHA-394x, AHA-398x, AHA-274x, AHA-274xT, AHA-2842, AHA-2910B, AHA-2920C, AHA-2930/U/U2, AHA-2940/W/U/UW/AU/, U2W/U2/U2B/, U2BOEM, AHA-2944D/WD/UD/UWD, AHA-2950U2/W/B, AHA-3940/U/W/UW/, AUW/U2W/U2B, AHA-3950U2D, AHA-3985/U/W/UW, AIC-777x, AIC-785x, AIC-786x, AIC-787x, AIC-788x , AIC-789x, AIC-3860 |
aic7xxx.ko
|
verbose — Enable verbose/diagnostic logging
allow_memio — Allow device registers to be memory mapped
debug — Bitmask of debug values to enable
no_probe — Toggle EISA/VLB controller probing
probe_eisa_vl — Toggle EISA/VLB controller probing
no_reset — Supress initial bus resets
extended — Enable extended geometry on all controllers
periodic_otag — Send an ordered tagged transaction periodically to prevent tag starvation. This may be required by some older disk drives or RAID arrays.
tag_info:<tag_str> — Set per-target tag depth
global_tag_depth:<int> — Global tag depth for every target on every bus
seltime:<int> — Selection Timeout (0/256ms,1/128ms,2/64ms,3/32ms)
|
IBM ServeRAID |
ips.ko
| |
LSI Logic MegaRAID Mailbox Driver |
megaraid_mbox.ko
|
unconf_disks — Set to expose unconfigured disks to kernel (default=0)
busy_wait — Max wait for mailbox in microseconds if busy (default=10)
max_sectors — Maximum number of sectors per IO command (default=128)
cmd_per_lun — Maximum number of commands per logical unit (default=64)
fast_load — Faster loading of the driver, skips physical devices! (default=0)
debug_level — Debug level for driver (default=0)
|
Emulex LightPulse Fibre Channel SCSI driver |
lpfc.ko
|
lpfc_poll — FCP ring polling mode control: 0 - none, 1 - poll with interrupts enabled 3 - poll and disable FCP ring interrupts
lpfc_log_verbose — Verbose logging bit-mask
lpfc_lun_queue_depth — Max number of FCP commands we can queue to a specific LUN
lpfc_hba_queue_depth — Max number of FCP commands we can queue to a lpfc HBA
lpfc_scan_down — Start scanning for devices from highest ALPA to lowest
lpfc_nodev_tmo — Seconds driver will hold I/O waiting for a device to come back
lpfc_topology — Select Fibre Channel topology
lpfc_link_speed — Select link speed
lpfc_fcp_class — Select Fibre Channel class of service for FCP sequences
lpfc_use_adisc — Use ADISC on rediscovery to authenticate FCP devices
lpfc_ack0 — Enable ACK0 support
lpfc_cr_delay — A count of milliseconds after which an interrupt response is generated
lpfc_cr_count — A count of I/O completions after which an interrupt response is generated
lpfc_multi_ring_support — Determines number of primary SLI rings to spread IOCB entries across
lpfc_fdmi_on — Enable FDMI support
lpfc_discovery_threads — Maximum number of ELS commands during discovery
lpfc_max_luns — Maximum allowed LUN
lpfc_poll_tmo — Milliseconds driver will wait between polling FCP ring
|
HP Smart Array | cciss.ko | |
LSI Logic MPT Fusion | mptbase.ko mptctl.ko mptfc.ko mptlan.ko mptsas.ko mptscsih.ko mptspi.ko |
mpt_msi_enable — MSI Support Enable
mptfc_dev_loss_tmo — Initial time the driver programs the transport to wait for an rport to return following a device loss event.
mpt_pt_clear — Clear persistency table
mpt_saf_te — Force enabling SEP Processor
|
QLogic Fibre Channel Driver | qla2xxx.ko |
ql2xlogintimeout — Login timeout value in seconds.
qlport_down_retry — Maximum number of command retries to a port that returns a PORT-DOWN status
ql2xplogiabsentdevice — Option to enable PLOGI to devices that are not present after a Fabric scan.
ql2xloginretrycount — Specify an alternate value for the NVRAM login retry count.
ql2xallocfwdump — Option to enable allocation of memory for a firmware dump during HBA initialization. Default is 1 - allocate memory.
extended_error_logging — Option to enable extended error logging.
ql2xfdmienable — Enables FDMI registrations.
|
NCR, Symbios and LSI 8xx and 1010 | sym53c8xx |
cmd_per_lun — The maximum number of tags to use by default
tag_ctrl — More detailed control over tags per LUN
burst — Maximum burst. 0 to disable, 255 to read from registers
led — Set to 1 to enable LED support
diff — 0 for no differential mode, 1 for BIOS, 2 for always, 3 for not GPIO3
irqm — 0 for open drain, 1 to leave alone, 2 for totem pole
buschk — 0 to not check, 1 for detach on error, 2 for warn on error
hostid — The SCSI ID to use for the host adapters
verb — 0 for minimal verbosity, 1 for normal, 2 for excessive
debug — Set bits to enable debugging
settle — Settle delay in seconds. Default 3
nvram — Option currently not used
excl — List ioport addresses here to prevent controllers from being attached
safe — Set other settings to a "safe mode"
|
ethtool
or mii-tool
. Only after these tools fail to work should module parameters be adjusted. Module parameters can be viewed using the modinfo
command.
ethtool
, mii-tool
, and modinfo
.
Hardware | Module | Parameters |
---|---|---|
3Com EtherLink PCI III/XL Vortex (3c590, 3c592, 3c595, 3c597) Boomerang (3c900, 3c905, 3c595) |
3c59x.ko
|
debug — 3c59x debug level (0-6)
options — 3c59x: Bits 0-3: media type, bit 4: bus mastering, bit 9: full duplex
global_options — 3c59x: same as options, but applies to all NICs if options is unset
full_duplex — 3c59x full duplex setting(s) (1)
global_full_duplex — 3c59x: same as full_duplex, but applies to all NICs if full_duplex is unset
hw_checksums — 3c59x Hardware checksum checking by adapter(s) (0-1)
flow_ctrl — 3c59x 802.3x flow control usage (PAUSE only) (0-1)
enable_wol — 3c59x: Turn on Wake-on-LAN for adapter(s) (0-1)
global_enable_wol — 3c59x: same as enable_wol, but applies to all NICs if enable_wol is unset
rx_copybreak — 3c59x copy breakpoint for copy-only-tiny-frames
max_interrupt_work — 3c59x maximum events handled per interrupt
compaq_ioaddr — 3c59x PCI I/O base address (Compaq BIOS problem workaround)
compaq_irq — 3c59x PCI IRQ number (Compaq BIOS problem workaround)
compaq_device_id — 3c59x PCI device ID (Compaq BIOS problem workaround)
watchdog — 3c59x transmit timeout in milliseconds
global_use_mmio — 3c59x: same as use_mmio, but applies to all NICs if options is unset
use_mmio — 3c59x: use memory-mapped PCI I/O resource (0-1)
|
RTL8139, SMC EZ Card Fast Ethernet, RealTek cards using RTL8129, or RTL8139 Fast Ethernet chipsets |
8139too.ko
| |
Broadcom 4400 10/100 PCI ethernet driver |
b44.ko
|
b44_debug — B44 bitmapped debugging message enable value
|
Broadcom NetXtreme II BCM5706/5708 Driver |
bnx2.ko
|
disable_msi — Disable Message Signaled Interrupt (MSI)
|
Intel Ether Express/100 driver |
e100.ko
|
debug — Debug level (0=none,...,16=all)
eeprom_bad_csum_allow — Allow bad eeprom checksums
|
Intel EtherExpress/1000 Gigabit |
e1000.ko
|
TxDescriptors — Number of transmit descriptors
RxDescriptors — Number of receive descriptors
Speed — Speed setting
Duplex — Duplex setting
AutoNeg — Advertised auto-negotiation setting
FlowControl — Flow Control setting
XsumRX — Disable or enable Receive Checksum offload
TxIntDelay — Transmit Interrupt Delay
TxAbsIntDelay — Transmit Absolute Interrupt Delay
RxIntDelay — Receive Interrupt Delay
RxAbsIntDelay — Receive Absolute Interrupt Delay
InterruptThrottleRate — Interrupt Throttling Rate
SmartPowerDownEnable — Enable PHY smart power down
KumeranLockLoss — Enable Kumeran lock loss workaround
|
Myricom 10G driver (10GbE) |
myri10ge.ko
|
myri10ge_fw_name — Firmware image name
myri10ge_ecrc_enable — Enable Extended CRC on PCI-E
myri10ge_max_intr_slots — Interrupt queue slots
myri10ge_small_bytes — Threshold of small packets
myri10ge_msi — Enable Message Signalled Interrupts
myri10ge_intr_coal_delay — Interrupt coalescing delay
myri10ge_flow_control — Pause parameter
myri10ge_deassert_wait — Wait when deasserting legacy interrupts
myri10ge_force_firmware — Force firmware to assume aligned completions
myri10ge_skb_cross_4k — Can a small skb cross a 4KB boundary?
myri10ge_initial_mtu — Initial MTU
myri10ge_napi_weight — Set NAPI weight
myri10ge_watchdog_timeout — Set watchdog timeout
myri10ge_max_irq_loops — Set stuck legacy IRQ detection threshold
|
NatSemi DP83815 Fast Ethernet |
natsemi.ko
|
mtu — DP8381x MTU (all boards)
debug — DP8381x default debug level
rx_copybreak — DP8381x copy breakpoint for copy-only-tiny-frames
options — DP8381x: Bits 0-3: media type, bit 17: full duplex
full_duplex — DP8381x full duplex setting(s) (1)
|
AMD PCnet32 and AMD PCnetPCI |
pcnet32.ko
| |
PCnet32 and PCnetPCI |
pcnet32.ko
|
debug — pcnet32 debug level
max_interrupt_work — pcnet32 maximum events handled per interrupt
rx_copybreak — pcnet32 copy breakpoint for copy-only-tiny-frames
tx_start_pt — pcnet32 transmit start point (0-3)
pcnet32vlb — pcnet32 Vesa local bus (VLB) support (0/1)
options — pcnet32 initial option setting(s) (0-15)
full_duplex — pcnet32 full duplex setting(s) (1)
homepna — pcnet32 mode for 79C978 cards (1 for HomePNA, 0 for Ethernet, default Ethernet
|
RealTek RTL-8169 Gigabit Ethernet driver |
r8169.ko
|
media — force phy operation. Deprecated by ethtool (8).
rx_copybreak — Copy breakpoint for copy-only-tiny-frames
use_dac — Enable PCI DAC. Unsafe on 32 bit PCI slot.
debug — Debug verbosity level (0=none, ..., 16=all)
|
Neterion Xframe 10GbE Server Adapter |
s2io.ko
| |
SIS 900/701G PCI Fast Ethernet |
sis900.ko
|
multicast_filter_limit — SiS 900/7016 maximum number of filtered multicast addresses
max_interrupt_work — SiS 900/7016 maximum events handled per interrupt
sis900_debug — SiS 900/7016 bitmapped debugging message level
|
Adaptec Starfire Ethernet driver |
starfire.ko
|
max_interrupt_work — Maximum events handled per interrupt
mtu — MTU (all boards)
debug — Debug level (0-6)
rx_copybreak — Copy breakpoint for copy-only-tiny-frames
intr_latency — Maximum interrupt latency, in microseconds
small_frames — Maximum size of receive frames that bypass interrupt latency (0,64,128,256,512)
options — Deprecated: Bits 0-3: media type, bit 17: full duplex
full_duplex — Deprecated: Forced full-duplex setting (0/1)
enable_hw_cksum — Enable/disable hardware cksum support (0/1)
|
Broadcom Tigon3 |
tg3.ko
|
tg3_debug — Tigon3 bitmapped debugging message enable value
|
ThunderLAN PCI |
tlan.ko
|
aui — ThunderLAN use AUI port(s) (0-1)
duplex — ThunderLAN duplex setting(s) (0-default, 1-half, 2-full)
speed — ThunderLAN port speen setting(s) (0,10,100)
debug — ThunderLAN debug mask
bbuf — ThunderLAN use big buffer (0-1)
|
Digital 21x4x Tulip PCI Ethernet cards SMC EtherPower 10 PCI(8432T/8432BT) SMC EtherPower 10/100 PCI(9332DST) DEC EtherWorks 100/10 PCI(DE500-XA) DEC EtherWorks 10 PCI(DE450) DEC QSILVER's, Znyx 312 etherarray Allied Telesis LA100PCI-T Danpex EN-9400, Cogent EM110 |
tulip.ko
|
io io_port
|
VIA Rhine PCI Fast Ethernet cards with either the VIA VT86c100A Rhine-II PCI or 3043 Rhine-I D-Link DFE-930-TX PCI 10/100 |
via-rhine.ko
|
max_interrupt_work — VIA Rhine maximum events handled per interrupt
debug — VIA Rhine debug level (0-7)
rx_copybreak — VIA Rhine copy breakpoint for copy-only-tiny-frames
avoid_D3 — Avoid power state D3 (work-around for broken BIOSes)
|
alias
and, possibly, options
lines for each card in /etc/modprobe.conf
.
bonding
kernel module and a special network interface, called a channel bonding interface. Channel bonding enables two or more network interfaces to act as one, simultaneously increasing the bandwidth and providing redundancy.
/etc/modprobe.conf
:
alias bond<N>
bonding
<N>
with the interface number, such as 0
. For each configured channel bonding interface, there must be a corresponding entry in /etc/modprobe.conf
.
miimon
or arp_interval
and the arp_ip_target
parameters. Refer to 43.5.2.1절. “bonding Module Directives” for a list of available options and how to quickly determine the best ones for your bonded interface.
BONDING_OPTS="<bonding parameters>
"
directive in your bonding interface configuration file (ifcfg-bond0
for example). Parameters to bonded interfaces can be configured without unloading (and reloading) the bonding module by manipulating files in the sysfs
file system.
sysfs
is a virtual file system that represents kernel objects as directories, files and symbolic links. sysfs
can be used to query for information about kernel objects, and can also manipulate those objects through the use of normal file system commands. The sysfs
virtual file system has a line in /etc/fstab
, and is mounted under /sys
. All bonded interfaces can be configured dynamically by interacting with and manipulating files under the /sys/class/net/
directory.
ifcfg-bond0
and inserted SLAVE=yes
and MASTER=bond0
directives in the bonded interfaces following the instructions in 15.2.3절. “채널 결합 인터페이스”, you can proceed to testing and determining the best parameters for your bonded interface.
ifconfig bond<N>
up
as root:
ifconfig bond0 up
ifcfg-bond0
bonding interface file, you will be able to see bond0
listed in the output of running ifconfig
(without any options):
~]# ifconfig
bond0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
eth0 Link encap:Ethernet HWaddr 52:54:00:26:9E:F1
inet addr:192.168.122.251 Bcast:192.168.122.255 Mask:255.255.255.0
inet6 addr: fe80::5054:ff:fe26:9ef1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:207 errors:0 dropped:0 overruns:0 frame:0
TX packets:205 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:70374 (68.7 KiB) TX bytes:25298 (24.7 KiB)
[output truncated]
~]# cat /sys/class/net/bonding_masters
bond0
/sys/class/net/bond<N>
/bonding/
directory. First, the bond you are configuring must be taken down:
ifconfig bond0 down
echo 1000 > /sys/class/net/bond0/bonding/miimon
balance-alb
mode, you could run either:
echo 6 > /sys/class/net/bond0/bonding/mode
echo balance-alb > /sys/class/net/bond0/bonding/mode
ifconfig bond<N>
up
. If you decide to change the options, take the interface down, modify its parameters using sysfs
, bring it back up, and re-test.
BONDING_OPTS=
directive of the /etc/sysconfig/network-scripts/ifcfg-bond<N>
file for the bonded interface you are configuring. Whenever that bond is brought up (for example, by the system during the boot sequence if the ONBOOT=yes
directive is set), the bonding options specified in the BONDING_OPTS
will take effect for that bond. For more information on configuring bonded interfaces (and BONDING_OPTS
), refer to 15.2.3절. “채널 결합 인터페이스”.
bonding
module. For more in-depth information on configuring channel bonding and the exhaustive list of bonding module parameters, install the kernel-doc package and then locating and opening the included bonding.txt
file:
yum -y install kernel-doc
nano -w $(rpm -ql kernel-doc | grep bonding.txt)
arp_interval=<time_in_milliseconds>
arp_interval
and arp_ip_target
parameters are specified, or, alternatively, the miimon
parameter is specified. Failure to do so can cause degradation of network performance in the event that a link fails.
mode=0
or mode=1
(the two load-balancing modes), the network switch must be configured to distribute packets evenly across the NICs. For more information on how to accomplish this, refer to /usr/share/doc/kernel-doc-<kernel_version>
/Documentation/networking/bonding.txt
0
by default, which disables it.
arp_ip_target=<ip_address>
[,<ip_address_2>
,...<ip_address_16>
]
arp_interval
parameter is enabled. Up to 16 IP addresses can be specified in a comma separated list.
arp_validate=<value>
none
. Other valid values are active
, backup
, and all
.
debug=<number>
0
— Debug messages are disabled. This is the default.
1
— Debug messages are enabled.
downdelay=<time_in_milliseconds>
miimon
parameter. The value is set to 0
by default, which disables it.
<value>
slow
or 0
— Default setting. This specifies that partners should transmit LACPDUs every 30 seconds.
fast
or 1
— Specifies that partners should transmit LACPDUs every 1 second.
miimon=<time_in_milliseconds>
ethtool <interface_name>
| grep "Link detected:"
<interface_name
> with the name of the device interface, such as eth0
, not the bond interface. If MII is supported, the command returns:
Link detected: yes
0
(the default), turns this feature off. When configuring this setting, a good starting point for this parameter is 100
.
arp_interval
and arp_ip_target
parameters are specified, or, alternatively, the miimon
parameter is specified. Failure to do so can cause degradation of network performance in the event that a link fails.
mode=<value>
<value>
is one of:
balance-rr
or 0
— Sets a round-robin policy for fault tolerance and load balancing. Transmissions are received and sent out sequentially on each bonded slave interface beginning with the first one available.
active-backup
or 1
— Sets an active-backup policy for fault tolerance. Transmissions are received and sent out via the first available bonded slave interface. Another bonded slave interface is only used if the active bonded slave interface fails.
balance-xor
or 2
— Sets an XOR (exclusive-or) policy for fault tolerance and load balancing. Using this method, the interface matches up the incoming request's MAC address with the MAC address for one of the slave NICs. Once this link is established, transmissions are sent out sequentially beginning with the first available interface.
broadcast
or 3
— Sets a broadcast policy for fault tolerance. All transmissions are sent on all slave interfaces.
802.3ad
or 4
— Sets an IEEE 802.3ad dynamic link aggregation policy. Creates aggregation groups that share the same speed and duplex settings. Transmits and receives on all slaves in the active aggregator. Requires a switch that is 802.3ad compliant.
balance-tlb
or 5
— Sets a Transmit Load Balancing (TLB) policy for fault tolerance and load balancing. The outgoing traffic is distributed according to the current load on each slave interface. Incoming traffic is received by the current slave. If the receiving slave fails, another slave takes over the MAC address of the failed slave.
balance-alb
or 6
— Sets an Active Load Balancing (ALB) policy for fault tolerance and load balancing. Includes transmit and receive load balancing for IPV4 traffic. Receive load balancing is achieved through ARP negotiation.
num_unsol_na=<number>
0 - 255
; the default value is 1
. This option affects only the active-backup mode.
primary=<interface_name>
eth0
, of the primary device. The primary
device is the first of the bonding interfaces to be used and is not abandoned unless it fails. This setting is particularly useful when one NIC in the bonding interface is faster and, therefore, able to handle a bigger load.
active-backup
mode. Refer to /usr/share/doc/kernel-doc-<kernel-version>
/Documentation/networking/bonding.txt
for more information.
primary_reselect=<value>
always
or 0
(default) — The primary slave becomes the active slave whenever it comes back up.
better
or 1
— The primary slave becomes the active slave when it comes back up, if the speed and duplex of the primary slave is better than the speed and duplex of the current active slave.
failure
or 2
— The primary slave becomes the active slave only if the current active slave fails and the primary slave is up.
primary_reselect
setting is ignored in two cases:
primary_reselect
policy via sysfs
will cause an immediate selection of the best active slave according to the new policy. This may or may not result in a change of the active slave, depending upon the circumstances
updelay=<time_in_milliseconds>
miimon
parameter. The value is set to 0
by default, which disables it.
use_carrier=<number>
miimon
should use MII/ETHTOOL ioctls or netif_carrier_ok()
to determine the link state. The netif_carrier_ok()
function relies on the device driver to maintains its state with netif_carrier_on/off
; most device drivers support this function.
netif_carrier_on/off
.
1
— Default setting. Enables the use of netif_carrier_ok()
.
0
— Enables the use of MII/ETHTOOL ioctls.
netif_carrier_on/off
.
xmit_hash_policy=<value>
balance-xor
and 802.3ad
modes. Possible values are:
0
or layer2
— Default setting. This option uses the XOR of hardware MAC addresses to generate the hash. The formula used is:
(<source_MAC_address>
XOR<destination_MAC>
) MODULO<slave_count>
1
or layer3+4
— Uses upper layer protocol information (when available) to generate the hash. This allows for traffic to a particular network peer to span multiple slaves, although a single connection will not span multiple slaves.
((<source_port>
XOR<dest_port>
) XOR ((<source_IP>
XOR<dest_IP>
) AND0xffff
) MODULO<slave_count>
layer2
transmit hash policy.
2
or layer2+3
— Uses a combination of layer2 and layer3 protocol information to generate the hash.
(((<source_IP>
XOR<dest_IP>
) AND0xffff
) XOR (<source_MAC>
XOR<destination_MAC>
)) MODULO<slave_count>
lsmod
man page — description and explanation of its output.
insmod
man page — description and list of command line options.
modprobe
man page — description and list of command line options.
rmmod
man page — description and list of command line options.
modinfo
man page — description and list of command line options.
/usr/share/doc/kernel-doc-<version>
/Documentation/kbuild/modules.txt
— how to compile and use kernel modules. Note you must have the kernel-doc
package installed to read this file.
kdump
is an advanced crash dumping mechanism. When enabled, the system is booted from the context of another kernel. This second kernel reserves a small amount of memory, and its only purpose is to capture the core dump image in case the system crashes. Since being able to analyze the core dump helps significantly to determine the exact cause of the system failure, it is strongly recommended to have this feature enabled.
kdump
service in Red Hat Enterprise Linux, and provides a brief overview of how to analyze the resulting core dump using the crash debugging utility.
kdump
Servicekdump
service, you must have the kexec-tools package installed. Refer to II부. 패키지 관리 for more information on how to install new packages in Red Hat Enterprise Linux.
kdump
service: at the first boot, using the Kernel Dump Configuration graphical utility, and doing so manually on the command line. It also describes how to test the configuration to verify that everything works as expected.
kdump
service.
kdump
configuration screen
kdump
crash recovery is enabled, the minimum memory requirements increase by the amount of memory reserved for it. This value is determined by a user, and defaults to 128 MB.
kdump
daemon at boot time, select the Enable kdump? check box. This will enable the service for runlevels 2
, 3
, 4
, and 5
, and start it for the current session. Similarly, unselecting the check box will disable it for all runlevels and stop the service immediately.
kdump
kernel, click the up and down arrow buttons next to the Kdump Memory field to increase or decrease the value. Notice that the Usable System Memory field changes accordingly showing you the remaining memory that will be available to the system.
system-config-kdump
at a shell prompt (for example, xterm or GNOME Terminal). Unless you are already authenticated, you will be prompted to enter the superuser password.
kdump
as well as to enable or disable starting the service at boot time. When you are done, click to save the changes. The system reboot will be requested.
kdump
crash recovery is enabled, the minimum memory requirements increase by the amount of memory reserved for it. This value is determined by a user, and defaults to 128 MB.
kdump
daemon at boot time, select the Enable kdump check box. This will enable the service for runlevels 2
, 3
, 4
, and 5
, and start it for the current session. Similarly, unselecting the check box will disable it for all runlevels and stop the service immediately.
kdump
kernel, click the up and down arrow buttons next to the New kdump Memory field to increase or decrease the value. Notice that the Usable Memory field changes accordingly showing you the remaining memory that will be available to the system.
/dev/sdb1
). When you are done, click to confirm your choice.
hostname:directory
form (for example, penguin.example.com:/export
). Clicking the button will confirm your changes. Finally, edit the value of the Path field to customize the destination directory (for instance, cores
).
username@hostname
form (for example, john@penguin.example.com
). Clicking the button will confirm your changes. Finally, edit the value of the Path field to customize the destination directory (for instance, /export/cores
).
vmcore
dump file, kdump
allows you to specify an external application (that is, a core collector) to compress the data, and optionally leave out all irrelevant information. Currently, the only fully supported core collector is makedumpfile
.
-c
parameter is listed after the makedumpfile
command in the Core Collector field (for example, makedumpfile -c
).
-d value
parameter after the makedumpfile
command in the Core Collector field. The value
is a sum of values of pages you want to omit as described in 표 44.1. “Supported filtering levels”. For example, to remove both zero and free pages, use makedumpfile -d 17
.
makedumpfile
for a complete list of available options.
kdump
fails to create a core dump, select the appropriate option from the Default Action pulldown list. Available options are (the default action), (to reboot the system), (to present a user with an interactive shell prompt), and (to halt the system).
kdump
on the Command Line~]$ su -
Password:
kdump
kernel, open the /boot/grub/grub.conf
file in a text editor and add the crashkernel=<size>
M@16M
parameter to the list of kernel options as shown in 예 44.1. “A sample /boot/grub/grub.conf
file”.
/boot/grub/grub.conf
file# grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,0) # kernel /vmlinuz-version ro root=/dev/sda3 # initrd /initrd-version.img #boot=/dev/sda default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title Red Hat Enterprise Linux Server (2.6.18-274.3.1.el5) root (hd0,0) kernel /vmlinuz-2.6.18-274.3.1.el5 ro root=/dev/sda3 crashkernel=128M@16M initrd /initrd-2.6.18-274.3.1.el5.img
kdump
crash recovery is enabled, the minimum memory requirements increase by the amount of memory reserved for it. This value is determined by a user, and defaults to 128 MB, as lower values proved to be unreliable. For more information on minimum memory requirements for Red Hat Enterprise Linux, refer to the Required minimums section of the Red Hat Enterprise Linux comparison chart.
vmcore
file in the /var/crash/
directory of the local file system. To change this, open the /etc/kdump.conf
configuration file in a text editor and edit the options as described below.
#path /var/crash
line, and replace the value with a desired directory path. Optionally, if you wish to write the file to a different partition, follow the same procedure with the #ext3 /dev/sda3
line as well, and change both the file system type and the device (a device name, a file system label, and UUID are all supported) accordingly. For example:
ext3 /dev/sda4 path /usr/local/cores
#raw /dev/sda5
line, and replace the value with a desired device name. For example:
raw /dev/sdb1
#net my.server.com:/export/tmp
line, and replace the value with a valid hostname and directory path. For example:
net penguin.example.com:/export/cores
#net user@my.server.com
line, and replace the value with a valid username and hostname. For example:
net john@penguin.example.com
vmcore
dump file, kdump
allows you to specify an external application (that is, a core collector) to compress the data, and optionally leave out all irrelevant information. Currently, the only fully supported core collector is makedumpfile
.
/etc/kdump.conf
configuration file in a text editor, remove the hash sign (“#”) from the beginning of the #core_collector makedumpfile -c --message-level 1
line, and edit the command line options as described below.
-c
parameter. For example:
core_collector makedumpfile -c
-d value
parameter, where value
is a sum of values of pages you want to omit as described in 표 44.1. “Supported filtering levels”. For example, to remove both zero and free pages, use the following:
core_collector makedumpfile -d 17 -c
makedumpfile
for a complete list of available options.
Option | Description |
---|---|
1
| Zero pages |
2
| Cache pages |
4
| Cache private |
8
| User pages |
16
| Free pages |
kdump
fails to create a core dump, the root file system is mounted and /sbin/init
is run. To change this behavior, open the /etc/kdump.conf
configuration file in a text editor, remove the hash sign (“#”) from the beginning of the #default shell
line, and replace the value with a desired action as described in 표 44.2. “Supported actions”. For example:
default halt
Option | Action |
---|---|
reboot
| Reboot the system, losing the core in the process. |
halt
| After failing to capture a core, halt the system. |
shell
| Run the msh session from within the initramfs, allowing a user to record the core manually. |
kdump
daemon at boot time, type the following at a shell prompt:
~]# chkconfig kdump on
2
, 3
, 4
, and 5
. Similarly, typing chkconfig kdump off
will disable it for all runlevels. To start the service in the current session, use the following command:
~]# service kdump start
No kdump initial ramdisk found. [WARNING]
Rebuilding /boot/initrd-2.6.18-194.8.1.el5kdump.img
Starting kdump: [ OK ]
kdump
enabled, and make sure that the service is running:
~]# service kdump status
Kdump is operational
~]#echo 1 > /proc/sys/kernel/sysrq
~]#echo c > /proc/sysrq-trigger
YYYY-MM-DD
-HH:MM
/vmcore
file will be copied to the location you have selected in the configuration (that is, to /var/crash/
by default).
vmcore
dump file, you must have the crash and kernel-debuginfo packages installed. To do so, type the following at a shell prompt:
~]# yum install --enablerepo=rhel-debuginfo crash kernel-debuginfo
netdump
, diskdump
, xendump
, or kdump
. When started, it presents you with an interactive prompt very similar to the GNU Debugger (GDB).
crash /var/crash/timestamp
/vmcore /usr/lib/debug/lib/modules/kernel
/vmlinux
kernel
version should be the same as the one that was captured by kdump
. To find out which kernel you are currently running, use the uname -r
command.
crash
utility~]#crash /var/crash/2010-08-04-17\:55/vmcore \
/usr/lib/debug/lib/modules/2.6.18-194.8.1.el5/vmlinux
crash 4.1.2-4.el5_5.1 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Red Hat, Inc. Copyright (C) 2004, 2005, 2006 IBM Corporation Copyright (C) 1999-2006 Hewlett-Packard Co Copyright (C) 2005, 2006 Fujitsu Limited Copyright (C) 2006, 2007 VA Linux Systems Japan K.K. Copyright (C) 2005 NEC Corporation Copyright (C) 1999, 2002, 2007 Silicon Graphics, Inc. Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc. This program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Enter "help copying" to see the conditions. This program has absolutely no warranty. Enter "help warranty" for details. GNU gdb 6.1 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"... KERNEL: /usr/lib/debug/lib/modules/2.6.18-194.8.1.el5/vmlinux DUMPFILE: /var/crash/2010-08-04-17:55/vmcore CPUS: 1 DATE: Wed Aug 4 17:50:41 2010 UPTIME: 00:56:53 LOAD AVERAGE: 0.47, 0.47, 0.55 TASKS: 128 NODENAME: localhost.localdomain RELEASE: 2.6.18-194.el5 VERSION: #1 SMP Tue Mar 16 21:52:43 EDT 2010 MACHINE: i686 (2702 Mhz) MEMORY: 1 GB PANIC: "SysRq : Trigger a crashdump" PID: 6042 COMMAND: "bash" TASK: f09c7000 [THREAD_INFO: e1ba9000] CPU: 0 STATE: TASK_RUNNING (SYSRQ) crash>
exit
.
log
command at the interactive prompt.
crash> log
Linux version 2.6.18-194.el5 (mockbuild@x86-007.build.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Tue Mar 16 21:52:43 EDT 2010
BIOS-provided physical RAM map:
BIOS-e820: 0000000000010000 - 000000000009fc00 (usable)
BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 000000003fff0000 (usable)
BIOS-e820: 000000003fff0000 - 0000000040000000 (ACPI data)
BIOS-e820: 00000000fffc0000 - 0000000100000000 (reserved)
127MB HIGHMEM available.
896MB LOWMEM available.
Using x86 segment limits to approximate NX protection
On node 0 totalpages: 262128
DMA zone: 4096 pages, LIFO batch:0
Normal zone: 225280 pages, LIFO batch:31
HighMem zone: 32752 pages, LIFO batch:7
DMI 2.5 present.
Using APIC driver default
... several lines omitted ...
SysRq : Trigger a crashdump
help log
for more information on the command usage.
bt
command at the interactive prompt. You can use bt pid
to display the backtrace of the selected process.
crash> bt
PID: 6042 TASK: f09c7000 CPU: 0 COMMAND: "bash"
#0 [e1ba9d10] schedule at c061c738
#1 [e1ba9d28] netlink_getsockopt at c05d50bb
#2 [e1ba9d34] netlink_queue_skip at c05d40d5
#3 [e1ba9d40] netlink_sock_destruct at c05d506d
#4 [e1ba9d84] sock_recvmsg at c05b6cc8
#5 [e1ba9dd4] enqueue_task at c041eed5
#6 [e1ba9dec] try_to_wake_up at c041f798
#7 [e1ba9e10] vsnprintf at c04efef2
#8 [e1ba9ec0] machine_kexec at c0419bf0
#9 [e1ba9f04] sys_kexec_load at c04448a1
#10 [e1ba9f4c] tty_audit_exit at c0549f06
#11 [e1ba9f50] tty_audit_add_data at c0549d5d
#12 [e1ba9f84] do_readv_writev at c0476055
#13 [e1ba9fb8] system_call at c0404f10
EAX: ffffffda EBX: 00000001 ECX: b7f7f000 EDX: 00000002
DS: 007b ESI: 00000002 ES: 007b EDI: b7f7f000
SS: 007b ESP: bf83f478 EBP: bf83f498
CS: 0073 EIP: 009ac402 ERR: 00000004 EFLAGS: 00000246
help bt
for more information on the command usage.
ps
command at the interactive prompt. You can use ps pid
to display the status of the selected process.
crash> ps
PID PPID CPU TASK ST %MEM VSZ RSS COMM
0 0 0 c068a3c0 RU 0.0 0 0 [swapper]
1 0 0 f7c81aa0 IN 0.1 2152 616 init
... several lines omitted ...
6017 1 0 e39f6550 IN 1.2 40200 13000 gnome-terminal
6019 6017 0 e39f6000 IN 0.1 2568 708 gnome-pty-helpe
6020 6017 0 f0421550 IN 0.1 4620 1480 bash
6021 1 0 f7f69aa0 ?? 1.2 40200 13000 gnome-terminal
6039 6020 0 e7e84aa0 IN 0.1 5004 1300 su
> 6042 6039 0 f09c7000 RU 0.1 4620 1464 bash
help ps
for more information on the command usage.
vm
command at the interactive prompt. You can use vm pid
to display information on the selected process.
crash> vm
PID: 6042 TASK: f09c7000 CPU: 0 COMMAND: "bash"
MM PGD RSS TOTAL_VM
e275ee40 e2b08000 1464k 4620k
VMA START END FLAGS FILE
e315d764 1fe000 201000 75 /lib/libtermcap.so.2.0.8
e315de9c 201000 202000 100073 /lib/libtermcap.so.2.0.8
c9b040d4 318000 46a000 75 /lib/libc-2.5.so
e315da04 46a000 46c000 100071 /lib/libc-2.5.so
e315d7b8 46c000 46d000 100073 /lib/libc-2.5.so
e315de48 46d000 470000 100073
e315dba8 9ac000 9ad000 8040075
c9b04a04 a2f000 a4a000 875 /lib/ld-2.5.so
c9b04374 a4a000 a4b000 100871 /lib/ld-2.5.so
e315d6bc a4b000 a4c000 100873 /lib/ld-2.5.so
e315d908 fa1000 fa4000 75 /lib/libdl-2.5.so
e315db00 fa4000 fa5000 100071 /lib/libdl-2.5.so
e315df44 fa5000 fa6000 100073 /lib/libdl-2.5.so
e315d320 ff0000 ffa000 75 /lib/libnss_files-2.5.so
e315d668 ffa000 ffb000 100071 /lib/libnss_files-2.5.so
e315def0 ffb000 ffc000 100073 /lib/libnss_files-2.5.so
e315d374 8048000 80f5000 1875 /bin/bash
c9b045c0 80f5000 80fa000 101873 /bin/bash
... several lines omitted ...
help vm
for more information on the command usage.
files
command at the interactive prompt. You can use files pid
to display files opened by the selected process.
crash> files
PID: 6042 TASK: f09c7000 CPU: 0 COMMAND: "bash"
ROOT: / CWD: /root
FD FILE DENTRY INODE TYPE PATH
0 e33be480 e609bf70 f0e1d880 CHR /dev/pts/1
1 e424d8c0 d637add8 f7809b78 REG /proc/sysrq-trigger
2 e33be480 e609bf70 f0e1d880 CHR /dev/pts/1
10 e33be480 e609bf70 f0e1d880 CHR /dev/pts/1
255 e33be480 e609bf70 f0e1d880 CHR /dev/pts/1
help files
for more information on the command usage.
man kdump.conf
/etc/kdump.conf
configuration file containing the full documentation of available options.
man kexec
kexec
containing the full documentation on its usage.
man crash
/usr/share/doc/kexec-tools-version
/kexec-kdump-howto.txt
kdump
and kexec
installation and usage.
kexec
and kdump
configuration.
차례
nmap
명령과 스캔할 시스템의 호스트명이나 IP 주소를 입력하십시오.
nmap foo.example.com
Starting nmap V. 3.50 ( www.insecure.org/nmap/ ) Interesting ports on localhost.localdomain (127.0.0.1): (The 1591 ports scanned but not shown below are in state: closed) Port State Service 22/tcp open ssh 25/tcp open smtp 111/tcp open sunrpc 443/tcp open https 515/tcp open printer 950/tcp open oftep-rpc 6000/tcp open X11 Nmap run completed -- 1 IP address (1 host up) scanned in 71.825 seconds
보안 취약점 | 설명 | 알림 | |||
---|---|---|---|---|---|
암호가 없거나 디폴트 암호를 사용하는 경우 | 관리자 암호를 설정하지 않거나 판매업체에서 설정한 디폴트 암호를 사용하는 경우는 라우터나 방화벽에서 자주 발생하지만 일부 리눅스 서비스도 기본 관리자 암호를 그대로 사용하는 경우가 종종 있습니다 (Red Hat Enterprise Linux 5는 제외). |
| |||
디폴트 공유 키 | 보안 서비스는 종종 개발용이나 평가 테스팅에 사용되는 기본 보안 키를 포함하고 있습니다. 만일 이 보안 키가 변경되지 않은 채 인터넷 상 생산 환경에 저장된다면, 동일한 기본 키를 가진 사용자라면 누구든지 그 공유-키와 그 키에 포함된 기밀 정보를 볼 수 있습니다. |
| |||
IP 스푸핑(Spoofing) | A remote machine acts as a node on your local network, finds vulnerabilities with your servers, and installs a backdoor program or Trojan horse to gain control over your network resources. |
| |||
도청 (Eavesdropping) | 네트워크 상 두 개의 활성 노드 사이의 통신 선로 전선에 접속하여 정보를 빼내는 행위. |
| |||
서비스 취약점 | 침입자는 인터넷 상에서 실행되는 서비스에서 허점을 찾아서 그 시스템에 칩입하여 저장된 정보를 가로챌 수 있습니다. 또한 동일한 네트워크 상에 위치한 다른 시스템에 침입하는 것도 가능합니다. |
| |||
응용 프로그램 보안 취약점 | Attackers find faults in desktop and workstation applications (such as e-mail clients) and execute arbitrary code, implant Trojan horses for future compromise, or crash systems. Further exploitation can occur if the compromised workstation has administrative privileges on the rest of the network. |
| |||
서비스 거부 (DoS) 공격 | Attacker or group of attackers coordinate against an organization's network or server resources by sending unauthorized packets to the target host (either server, router, or workstation). This forces the resource to become unavailable to legitimate users. |
|
/tmp/updates
, and save all the downloaded packages to it.
/mnt/cdrom
, use the following command to import it into the keyring (a database of trusted keys on the system):
rpm --import /mnt/cdrom/RPM-GPG-KEY-redhat-release
rpm -qa gpg-pubkey*
gpg-pubkey-37017186-45761324
rpm -qi
command followed by the output from the previous command, as in this example:
rpm -qi gpg-pubkey-37017186-45761324
rpm -K /tmp/updates/*.rpm
gpg OK
. If it doesn't, make sure you are using the correct Red Hat public key, as well as verifying the source of the content. Packages that do not pass GPG verifications should not be installed, as they may have been altered by a third party.
rpm -Uvh /tmp/updates/*.rpm
rpm -ivh /tmp/updates/<kernel-package>
<kernel-package>
in the previous example with the name of the kernel RPM.
rpm -e <old-kernel-package>
<old-kernel-package>
in the previous example with the name of the older kernel RPM.
glibc
, which are used by a number of applications and services. Applications utilizing a shared library typically load the shared code when the application is initialized, so any applications using the updated library must be halted and relaunched.
lsof
command as in the following example:
lsof /usr/lib/libwrap.so*
tcp_wrappers
package is updated.
sshd
, vsftpd
, and xinetd
.
/sbin/service
command as in the following example:
service <service-name>
restart
<service-name>
with the name of the service, such as sshd
.
xinetd
Servicesxinetd
super service only run when a there is an active connection. Examples of services controlled by xinetd
include Telnet, IMAP, and POP3.
xinetd
each time a new request is received, connections that occur after an upgrade are handled by the updated software. However, if there are active connections at the time the xinetd
controlled service is upgraded, they are serviced by the older version of the software.
xinetd
controlled service, upgrade the package for the service then halt all processes currently running. To determine if the process is running, use the ps
command and then use the kill
or killall
command to halt current instances of the service.
imap
packages are released, upgrade the packages, then type the following command as root into a shell prompt:
ps -aux | grep imap
kill <PID>
kill -9 <PID>
<PID>
with the process identification number (found in the second column of the ps
command) for an IMAP session.
killall imapd
cat
command.
grub-md5-crypt
/boot/grub/grub.conf
. Open the file and below the timeout
line in the main section of the document, add the following line:
password --md5 <password-hash>
/boot/grub/grub.conf
file must be edited.
title
line of the operating system that you want to secure, and add a line with the lock
directive immediately beneath it.
title DOS lock
password
line must be present in the main section of the /boot/grub/grub.conf
file for this method to work properly. Otherwise, an attacker can access the GRUB editor interface and remove the lock line.
lock
line to the stanza, followed by a password line.
title DOS lock password --md5 <password-hash>
/etc/passwd
file, which makes the system vulnerable to offline password cracking attacks. If an intruder can gain access to the machine as a regular user, they can copy the /etc/passwd
file to their own machine and run any number of password cracking programs against it. If there is an insecure password in the file, it is only a matter of time before the password cracker discovers it.
/etc/shadow
, which is readable only by the root user.
otrattw,tghwg.
7
for t
and the at symbol (@
) for a
:
o7r@77w,7ghwg.
H
.
o7r@77w,7gHwg.
passwd
, which is Pluggable Authentication Manager (PAM) aware and therefore checks to see if the password is too short or otherwise easy to crack. This check is performed using the pam_cracklib.so
PAM module. Since PAM is customizable, it is possible to add more password integrity checkers, such as pam_passwdqc
(available from http://www.openwall.com/passwdqc/) or to write a new module. For a list of available PAM modules, refer to http://www.kernel.org/pub/linux/libs/pam/modules.html. For more information about PAM, refer to 46.4절. “PAM (Pluggable Authentication Modules)”.
chage
command or the graphical User Manager (system-config-users
) application.
-M
option of the chage
command specifies the maximum number of days the password is valid. For example, to set a user's password to expire in 90 days, use the following command:
chage -M 90 <username>
<username>
with the name of the user. To disable password expiration, it is traditional to use a value of 99999
after the -M
option (this equates to a little over 273 years).
chage
command in interactive mode to modify multiple password aging and account details. Use the following command to enter interactive mode:
chage <username>
~]# chage davido
Changing the aging information for davido
Enter the new value, or press ENTER for the default
Minimum Password Age [0]: 10
Maximum Password Age [99999]: 90
Last Password Change (YYYY-MM-DD) [2006-08-18]:
Password Expiration Warning [7]:
Password Inactive [-1]:
Account Expiration Date (YYYY-MM-DD) [1969-12-31]:
~]#
system-config-users
at a shell prompt.
sudo
or su
. A setuid program is one that operates with the user ID (UID) of the program's owner rather than the user operating the program. Such programs are denoted by an s
in the owner section of a long format listing, as in the following example:
-rwsr-xr-x 1 root root 47324 May 1 08:09 /bin/su
s
may be upper case or lower case. If it appears as upper case, it means that the underlying permission bit has not been set.
pam_console.so
, some activities normally reserved only for the root user, such as rebooting and mounting removable media are allowed for the first user that logs in at the physical console (refer to 46.4절. “PAM (Pluggable Authentication Modules)” for more information about the pam_console.so
module.) However, other important system administration tasks, such as altering network settings, configuring a new mouse, or mounting network devices, are not possible without administrative privileges. As a result, system administrators must decide how much access the users on their network should receive.
/sbin/nologin
in the /etc/passwd
file.
영향을 미치는 사항 | 영향을 미치지 않는 사항 |
---|---|
Prevents access to the root shell and logs any such attempts. The following programs are prevented from accessing the root account:
|
Programs that do not require a shell, such as FTP clients, mail clients, and many setuid programs. The following programs are not prevented from accessing the root account:
|
/etc/securetty
file. This file lists all devices the root user is allowed to log into. If the file does not exist at all, the root user can log in through any communication device on the system, whether via the console or a raw network interface. This is dangerous, because a user can log in to their machine as root via Telnet, which transmits the password in plain text over the network.
/etc/securetty
file only allows the root user to log in at the console physically attached to the machine. To prevent the root user from logging in, remove the contents of this file by typing the following command at a shell prompt as root:
echo > /etc/securetty
securetty
support in the KDM, GDM, and XDM login managers, add the following line:
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
/etc/pam.d/gdm
/etc/pam.d/gdm-autologin
/etc/pam.d/gdm-fingerprint
/etc/pam.d/gdm-password
/etc/pam.d/gdm-smartcard
/etc/pam.d/kdm
/etc/pam.d/kdm-np
/etc/pam.d/xdm
/etc/securetty
file does not prevent the root user from logging in remotely using the OpenSSH suite of tools because the console is not opened until after authentication.
영향을 미치는 사항 | 영향을 미치지 않는 사항 |
---|---|
콘솔 또는 네트워크를 통하여 루트 계정에 액세스하지 못하게 합니다. 다음 프로그램을 사용하여 루트 계정에 액세스하지 못하게 합니다:
|
Programs that do not log in as root, but perform administrative tasks through setuid or other mechanisms. The following programs are not prevented from accessing the root account:
|
/etc/ssh/sshd_config
, and change the line that reads:
#PermitRootLogin yes
PermitRootLogin no
영향을 미치는 사항 | 영향을 미치지 않는 사항 |
---|---|
OpenSSH suite 도구를 사용하여 루트 액세스를 하지 못하게 합니다. 다음 프로그램을 사용하여 루트 계정으로 액세스하지 못하게 합니다:
|
Programs that are not part of the OpenSSH suite of tools.
|
/lib/security/pam_listfile.so
module, allows great flexibility in denying specific accounts. The administrator can use this module to reference a list of users who are not allowed to log in. To limit root access to a system service, edit the file for the target service in the /etc/pam.d/
directory and make sure the pam_listfile.so
module is required for authentication.
vsftpd
FTP server in the /etc/pam.d/vsftpd
PAM configuration file (the \
character at the end of the first line is not necessary if the directive is on a single line):
auth required /lib/security/pam_listfile.so item=user \ sense=deny file=/etc/vsftpd.ftpusers onerr=succeed
/etc/vsftpd.ftpusers
file and deny access to the service for any listed user. The administrator can change the name of this file, and can keep separate lists for each service or use one central list to deny access to multiple services.
/etc/pam.d/pop
and /etc/pam.d/imap
for mail clients, or /etc/pam.d/ssh
for SSH clients.
영향을 미치는 사항 | 영향을 미치지 않는 사항 |
---|---|
Prevents root access to network services that are PAM aware. The following services are prevented from accessing the root account:
|
PAM을 인식하지 않는 프로그램과 서비스.
|
su
or sudo
.
su
Commandsu
command, they are prompted for the root password and, after authentication, is given a root shell prompt.
su
command, the user is the root user and has absolute administrative access to the system[16]. In addition, once a user has become root, it is possible for them to use the su
command to change to any other user on the system without being prompted for a password.
usermod -G wheel <username>
<username>
with the username you want to add to the wheel
group.
system-config-users
at a shell prompt.
su
(/etc/pam.d/su
) in a text editor and remove the comment # from the following line:
auth required /lib/security/$ISA/pam_wheel.so use_uid
wheel
can use this program.
wheel
group by default.
sudo
Commandsudo
command offers another approach to giving users administrative access. When trusted users precede an administrative command with sudo
, they are prompted for their own password. Then, when they have been authenticated and assuming that the command is permitted, the administrative command is executed as if they were the root user.
sudo
command is as follows:
sudo <command>
<command>
would be replaced by a command normally reserved for the root user, such as mount
.
sudo
command should take extra care to log out before walking away from their machines since sudoers can use the command again without being asked for a password within a five minute period. This setting can be altered via the configuration file, /etc/sudoers
.
sudo
command allows for a high degree of flexibility. For instance, only users listed in the /etc/sudoers
configuration file are allowed to use the sudo
command and the command is executed in the user's shell, not a root shell. This means the root shell can be completely disabled, as shown in 46.1.4.2절. “루트 액세스를 허가하지 않기”.
sudo
command also provides a comprehensive audit trail. Each successful authentication is logged to the file /var/log/messages
and the command issued along with the issuer's user name is logged to the file /var/log/secure
.
sudo
command is that an administrator can allow different users access to specific commands based on their needs.
sudo
configuration file, /etc/sudoers
, should use the visudo
command.
visudo
and add a line similar to the following in the user privilege specification section:
juan ALL=(ALL) ALL
juan
, can use sudo
from any host and execute any command.
sudo
:
%users localhost=/sbin/shutdown -h now
/sbin/shutdown -h now
as long as it is issued from the console.
sudoers
has a detailed listing of options for this file.
cupsd
— The default print server for Red Hat Enterprise Linux.
lpd
— An alternative print server.
xinetd
— A super server that controls connections to a range of subordinate servers, such as gssftp
and telnet
.
sendmail
— The Sendmail Mail Transport Agent (MTA) is enabled by default, but only listens for connections from the localhost.
sshd
— The OpenSSH server, which is a secure replacement for Telnet.
cupsd
running. The same is true for portmap
. If you do not mount NFSv3 volumes or use NIS (the ypbind
service), then portmap
should be disabled.
system-config-services
), ntsysv, and chkconfig
. For information on using these tools, refer to 17장. 서비스로의 접근 통제.
netdump
, transmit the contents of memory over the network unencrypted. Memory dumps can contain passwords or, even worse, database entries and other sensitive information.
finger
and rwhod
reveal information about users of the system.
rlogin
, rsh
, telnet
, and vsftpd
.
rlogin
, rsh
, and telnet
) should be avoided in favor of SSH. Refer to 46.1.7절. “보안 강화된 통신 도구” for more information about sshd
.
finger
authd
(this was called identd
in previous Red Hat Enterprise Linux releases.)
netdump
netdump-server
nfs
rwhod
sendmail
smb
(Samba)
yppasswdd
ypserv
ypxfrd
system-config-securitylevel
). This tool creates broad iptables
rules for a general-purpose firewall using a control panel interface.
iptables
is probably a better option. Refer to 46.8절. “Firewalls” for more information. Refer to 46.9절. “IPTables” for a comprehensive guide to the iptables
command.
telnet
and rsh
. OpenSSH includes a network service called sshd
and three command line client applications:
ssh
— A secure remote console access client.
scp
— A secure remote copy command.
sftp
— A secure pseudo-ftp client that allows interactive file transfer sessions.
sshd
service is inherently secure, the service must be kept up-to-date to prevent security threats. Refer to 45.5절. “보안 업데이트” for more information.
xinetd
를 함께 사용하면 TCP 래퍼가 제공하는 보안 기능이 보다 강화됩니다.
xinetd
to create redundancy within service access controls. Refer to 46.8절. “Firewalls” for more information about implementing firewalls with iptables commands.
xinetd
.
hosts_options
메뉴얼 페이지를 참조하시기 바랍니다.
banner
옵션을 사용하십시오.
vsftpd
에 배너를 사용합니다. 먼저 배너 파일을 생성하셔야 합니다. 시스템 상 어디에서든 생성하실 수 있지만 이 파일은 사용될 데몬과 동일한 이름을 가져야 합니다. 이 예시에서 파일 이름은 /etc/banners/vsftpd
입니다:
220-Hello, %c 220-All activity on ftp.example.com is logged. 220-Inappropriate use will result in your access privileges being removed.
%c
토큰은 사용자명, 호스트명 또는 연결 메시지에 보다 효과가 있도록 사용자명과 IP 주소와 같은 다양한 클라이언트 정보를 제공합니다.
/etc/hosts.allow
파일에서 다음 줄을 추가하시면 됩니다:
vsftpd : ALL : banners /etc/banners/
spawn
지시자를 사용하여 침입이 시도된 호스트나 네트워크의 관리자에게 경고 메시지를 보낼 수 있습니다.
/etc/hosts.deny
파일에 다음과 같은 줄을 추가하시면, 연결 시도가 거부되며 특별 파일에 기록될 것입니다:
ALL : 206.182.68.0 : spawn /bin/ 'date' %c %d >> /var/log/intruder_alert
%d
토큰은 침입자가 접근하려고 시도한 서비스의 이름을 제공합니다.
/etc/hosts.allow
파일에 spawn
지시자를 추가하시기 바랍니다.
spawn
지시자는 모든 쉘 명령을 실행하므로, 특정 클라이언트가 서버에 접속을 시도할 경우 관리자에게 알리거나 여러 명령을 수행할 특수 스크립트를 작성하십시오.
severity
옵션을 사용하여 해당 서비스에 대한 여러 다른 기록 수준을 설정하실 수 있습니다.
info
대신 emerg
플래그를 지정하시고 이 포트로 들어오는 연결을 거부합니다.
/etc/hosts.deny
파일에 다음 줄을 추가하시면 됩니다:
in.telnetd : ALL : severity emerg
authpriv
기록 기능을 사용하지만 기록 심각성 수준을 기본 값인 info
에서 emerg
수준으로 높여서 로그 메시지를 콘솔에 바로 보여줍니다.
xinetd
를 사용하여 트랩(trap) 서비스를 설정하는 방법과 xinetd
서비스가 사용할 수 있는 자원의 양을 제어하는 방법에 대하여 중점적으로 설명해 보겠습니다. 서비스가 사용할 수 있는 자원의 한계를 설정하면 서비스 거부 (DoS) 공격을 좌절시킬 수 있습니다.모든 사용 가능한 옵션의 목록을 보시려면 xinetd
및 xinetd.conf
의 메뉴얼 페이지를 참조하시기 바랍니다.
xinetd
의 중요한 기능 중 하나는 전역 no_access
목록에 호스트를 추가할 수 있는 기능입니다. 이 목록에 포함된 호스트는 xinetd
가 관리하는 서비스에 정해진 기간 동안 또는 xinetd
가 재시작될 때까지 연결을 거부당합니다. 이 기능은 SENSOR
속성을 통해 실행 가능하며, 서버에서 포트를 스캔하려고 시도하는 호스트를 손쉽게 막을 수 있는 방법입니다.
SENSOR
를 설정하기 위한 첫번째 단계는 사용할 계획이 없는 서비스를 선택하는 것입니다. 이 예에서는 Telnet이 사용됩니다.
/etc/xinetd.d/telnet
파일에서 flags
줄을 다음과 같이 수정하시기 바랍니다:
flags = SENSOR
deny_time = 30
deny_time
속성에 사용 가능한 다른 값에는 FOREVER와 NEVER가 있습니다. FORVER는 xinetd
가 재시작될 때까지 연결을 거부하며, NEVER는 연결을 허용한 후 기록합니다.
disable = no
SENSOR
를 사용하여 보안을 위협하는 호스트로부터 연결을 검색하여 정지시키는 것이 좋은 방법이기는 하지만, 다음과 같은 두가지 결점이 있습니다:
SENSOR
가 실행 중인 사실을 이미 알고 있다면 자신의 IP 주소를 위장하여 특정 호스트에 서비스 거부 공격을 마운트한 후 금지된 포트에 연결할 수 있습니다.
xinetd
의 또 다른 중요한 기능은 서비스가 활용 가능한 자원의 양을 제어할 수 있는 기능입니다.
cps = <number_of_connections> <wait_period>
— Limits the rate of incoming connections. This directive takes two arguments:
<number_of_connections>
— The number of connections per second to handle. If the rate of incoming connections is higher than this, the service is temporarily disabled. The default value is fifty (50).
<wait_period>
— The number of seconds to wait before re-enabling the service after it has been disabled. The default interval is ten (10) seconds.
instances = <number_of_connections>
— Specifies the total number of connections allowed to a service. This directive accepts either an integer value or UNLIMITED
.
per_source = <number_of_connections>
— Specifies the number of connections allowed to a service by each host. This directive accepts either an integer value or UNLIMITED
.
rlimit_as = <number[K|M]>
— Specifies the amount of memory address space the service can occupy in kilobytes or megabytes. This directive accepts either an integer value or UNLIMITED
.
rlimit_cpu = <number_of_seconds>
— Specifies the amount of time in seconds that a service may occupy the CPU. This directive accepts either an integer value or UNLIMITED
.
xinetd
서비스가 시스템을 마비시키는 상황을 방지하는데 도움이 됩니다.
portmap
서비스는 NIS와 NFS와 같은 RPC 서비스에 사용되는 동적 포트 할당 데몬입니다. 이 데몬은 허술한 인증 메커니즘을 갖추고 있으며 데몬이 제어하는 서비스에 광범위한 포트를 할당 가능합니다. 따라서 보안 관리가 쉽지 않습니다.
portmap
을 보안 강화하게 되면 NFSv2와 NFSv3만 영향을 받습니다. NFSv4는 더 이상 portmap을 사용하지 않으므로 영향을 받지 않습니다. NFSv2 이나 NFSv3 서버를 구현할 계획이라면, portmap
이 사용되므로 다음 부분에서 설명된 내용을 따르십시오.
portmap
서비스에는 내장된 인증 방식이 없으므로 TCP 래퍼를 사용하여 이 서비스를 사용할 수 있는 네트워크나 호스트를 제한하는 것이 중요합니다.
portmap
서비스로 접근을 더 제한하시려면 서버에 iptables 규칙을 추가하여 특정 네트워크로 접근하는 것을 제한하시는 것이 좋습니다.
portmap
서비스로 192.168.0/24 네트워크와 로컬호스트에서 TCP 연결을 허용하는 두가지 IPTables 명령 예시입니다. Nautilus가 sgi_fam
서비스를 사용하는데 필요한 설정입니다. 모든 다른 패킷은 버립니다(drop).
iptables -A INPUT -p tcp -s! 192.168.0.0/24 --dport 111 -j DROP
iptables -A INPUT -p tcp -s 127.0.0.1 --dport 111 -j ACCEPT
iptables -A INPUT -p udp -s! 192.168.0.0/24 --dport 111 -j DROP
ypserv
,--> which is used in conjunction with portmap
and other related services to distribute maps of usernames, passwords, and other sensitive information to any computer claiming to be within its domain.
/usr/sbin/rpc.yppasswdd
— yppasswdd
서비스로도 불리우는 이 데몬은 사용자가 NIS 암호를 변경할 수 있게 해줍니다.
/usr/sbin/rpc.ypxfrd
— ypxfrd
서비스라고도 불리는 이 데몬은 네트워크 상에서 NIS 맵(map)을 전송합니다.
/usr/sbin/yppush
— 이 프로그램은 수정된 NIS 데이터베이스를 다수의 NIS 서버에 전달하는 역할을 합니다.
/usr/sbin/ypserv
— NIS 서버 데몬입니다.
portmap
service as outlined in 46.2.2절. “Portmap 보안 강화”, then address the following issues, such as network planning.
/etc/passwd
파일의 내용을 보는 것이 가능합니다:
ypcat -d <NIS_domain>
-h <DNS_hostname>
passwd
/etc/shadow
파일의 내용을 볼 수 있습니다:
ypcat -d <NIS_domain>
-h <DNS_hostname>
shadow
/etc/shadow
파일은 NIS map에 저장되지 않습니다.
o7hfawtgmhwg.domain.com
와 같은 임의 문자열로 생성하시는 것이 좋습니다. 유사한 방법으로 NIS 도메인 이름도 임의 문자열로 생성하시되 호스트명과 다른 이름을 생성하십시오. 이렇게 하시면 침입자가 NIS 서버에 액세스하는 것이 더욱 힘들어 집니다.
/var/yp/securenets
파일을 수정하기/var/yp/securenets
파일이 공백으로 비어있거나 (기본 설치를 수행한 후) 파일이 존재하지 않는 경우 NIS는 모든 네트워크를 청취합니다. 이러한 경우 가장 먼저 하실 것은 ypserv
가 적절한 네트워크에서 들어오는 요청만 응답하도록 이 파일에 넷마스크/네트워크 쌍을 입력하셔야 합니다.
/var/yp/securenets
파일 예제입니다:
255.255.255.0 192.168.0.0
/var/yp/securenets
파일을 생성하지 않은 상태에서 NIS 서버를 처음으로 시작하시면 안됩니다.
rpc.yppasswdd
는 예외입니다. 다른 두 개의 NIS 서버 데몬인 rpc.ypxfrd
와 ypserv
에 포트를 할당함으로서 방화벽 규칙을 생성하여 침입자가 NIS 서버 데몬에 침입하지 못하도록 보안을 강화할 수 있습니다.
/etc/sysconfig/network
파일에 다음과 같은 줄을 삽입하시기 바랍니다:
YPSERV_ARGS="-p 834" YPXFRD_ARGS="-p 835"
iptables -A INPUT -p tcp -s! 192.168.0.0/24 --dport 834 -j DROP
iptables -A INPUT -p tcp -s! 192.168.0.0/24 --dport 835 -j DROP
iptables -A INPUT -p udp -s! 192.168.0.0/24 --dport 834 -j DROP
iptables -A INPUT -p udp -s! 192.168.0.0/24 --dport 835 -j DROP
/etc/shadow
파일의 암호 해시가 네트워크 상에서 전달되는 것입니다. 만일 침입자가 NIS 도메인에 침입하여 네트워크 트래픽을 훔쳐보고 있다면 사용자명과 암호 해시를 모르게 수집할 수 있습니다. 충분한 시간이 주어진다면 암호 크래킹 프로그램을 사용하여 추측하기 쉬운 암호를 알아낸 후 침입자는 유효한 계정을 사용하여 네트워크에 액세스 가능합니다.
portmap
service as outlined in 46.2.2절. “Portmap 보안 강화”. NFS traffic now utilizes TCP in all versions, rather than UDP, and requires it when using NFSv4. NFSv4 now includes Kerberos user and group authentication, as part of the RPCSEC_GSS
kernel module. Information on portmap
is still included, since Red Hat Enterprise Linux supports NFSv2 and NFSv3, both of which utilize portmap
.
/etc/exports
파일을 통해 어느 파일 시스템은 익스포트할 것이고 이 디렉토리를 익스포트할 호스트는 무엇인지 결정합니다. 따라서 이 파일을 수정하실 때 불필요한 공간을 추가하지 않도록 주의하셔야 합니다.
/etc/exports
파일에서 다음과 같은 줄은 bob.example.com
호스트에서 /tmp/nfs/
디렉토리를 읽고 쓸 수 있도록 공유합니다.
/tmp/nfs/ bob.example.com(rw)
/etc/exports
파일에 이 줄을 삽입하시면 호스트명 다음에 삽입된 빈 공간 때문에 동일한 디렉토리를 bob.example.com
에 읽기 전용 허가를 가지고 공유하고 그 외 다른 전체 호스트에 읽기 쓰기 허가를 가지고 이 디렉토리를 공유합니다.
/tmp/nfs/ bob.example.com (rw)
showmount
명령을 사용하여 어떠한 디렉토리가 어떻게 공유되고 있는지 NFS 공유 설정을 확인해보시기 바랍니다:
showmount -e <hostname>
no_root_squash
옵션을 사용하지 마십시오nfsnobody
로 변경하도록 기본 설정되어 있습니다. 따라서 루트 사용자가 생성한 파일은 모두 nfsnobody
가 소유하게 되어 사용자 아이디 비트를 재설정하여 프로그램을 업로드하지 못하게 됩니다.
no_root_squash
is used, remote root users are able to change any file on the shared file system and leave applications infected by Trojans for other users to inadvertently execute.
FollowSymLinks
/
로 심볼릭 링크를 제공하는 것은 좋은 생각이 아닙니다.
Indexes
지시자UserDir
지시자UserDir
지시자는 침입자가 시스템 상에 사용자 계정이 존재하는지 확인할 수 있기 때문에 비활성화되도록 기본 설정되어 있습니다. 서버에서 사용자 디렉토리 검색 기능을 활성화하시려면 다음 지시자를 사용하시기 바랍니다:
UserDir enabled UserDir disabled root
/root/
를 제외한 모든 사용자 디렉토리에서 활성화할 것입니다. 비활성 계정 목록에 사용자를 추가하시려면 UserDir disabled
줄에 사용자 이름을 빈칸으로 구분하여 추가하십시오.
IncludesNoExec
지시자를 삭제하지 마십시오gssftpd
— 커베로스를 사용하는 xinetd
-기반 FTP 데몬으로서 인증 정보를 네트워크 상에서 전달하지 않습니다.
tux
) — FTP 기능을 갖춘 커널 영역 웹 서버.
vsftpd
— 독립형, 보안 FTP 서비스
vsftpd
FTP 서비스를 설정하는데 사용되는 보안 정책입니다.
vsftpd
의 환영 배너를 변경하시려면 /etc/vsftpd/vsftpd.conf
파일에 다음 지시자를 추가하시기 바랍니다:
ftpd_banner=<insert_greeting_here>
<insert_greeting_here>
in the above directive with the text of the greeting message.
/etc/banners/
라는 새 디렉토리를 만드신 후 모든 패너 파일을 이 디렉토리에 저장하십시오. 이 예시에서 FTP 접속에 사용되는 배너 파일은 /etc/banners/ftp.msg
입니다. 다음은 이 파일의 내용 예제입니다:
######### # 안녕하세요, ftp.example.com에 있는 모든 작업은 기록됩니다. #########
220
as specified in 46.2.1.1.1절. “TCP 래퍼와 연결 배너”.
vsftpd
에 이 환경 배너 파일을 사용하기 위해서는 /etc/vsftpd/vsftpd.conf
파일에 다음과 같은 지시자를 추가하십시오:
banner_file=/etc/banners/ftp.msg
/etc/vsftpd/vsftpd.conf
, or else every attempt to connect to vsftpd will result in the connection being closed immediately and a 500 OOPS: cannot open banner <path_to_banner_file>
error message.
banner_file
directive in /etc/vsftpd/vfsftpd.conf
takes precedence over any ftpd_banner
directives in the configuration file: if banner_file
is specified, then ftpd_banner
is ignored.
/var/ftp/
디렉토리를 생성하시면 익명 계정이 활성화됩니다.
vsftpd
패키지를 설치하는 것입니다. 이 패키지는 익명 사용자를 위한 디렉토리 구조를 설정하고, 익명 사용자에게 이 디렉토리를 읽기만 할 수 있는 허가를 설정합니다.
/var/ftp/pub/
에 쓰기 전용 디렉토리를 생성하시기를 권장합니다.
mkdir /var/ftp/pub/upload
chmod 730 /var/ftp/pub/upload
drwx-wx--- 2 root ftp 4096 Feb 13 20:05 upload
vsftpd
에서 추가적으로 다음 줄을 /etc/vsftpd/vsftpd.conf
파일에 첨가하십시오:
anon_upload_enable=YES
vsftpd
에서 사용자 계정을 비활성화하시려면 /etc/vsftpd/vsftpd.conf
파일에 다음 지시자를 추가하십시오:
local_enable=NO
sudo
privileges, the easiest way is to use a PAM list file as described in 46.1.4.2절. “루트 액세스를 허가하지 않기”. The PAM configuration file for vsftpd
is /etc/pam.d/vsftpd
.
vsftpd
에서 특정 사용자 계정을 비활성화시키려면 /etc/vsftpd.ftpusers
에 해당 사용자명을 추가하시면 됩니다.
/etc/mail/sendmail.cf
by editing the /etc/mail/sendmail.mc
and using the m4
command.
/etc/mail/sendmail.mc
에 다음과 같은 지시자를 제한 설정하여 이와 같은 서비스 거부 공격이 발생할 가능성을 줄일 수 있습니다.
confCONNECTION_RATE_THROTTLE
— 일초당 서버가 받을 수 있는 연결 수를 지정합니다. Sendmail은 기본적으로 연결 수를 제한하지 않습니다. 만일 제한이 설정된 경우 한계수에 이르게 되면 그 후에 들어오는 연결은 지연됩니다.
confMAX_DAEMON_CHILDREN
— 서버에서 배출할 수 있는 최대 자식 프로세스 수. Sendmail은 기본적으로 자식 프로세스의 수를 제한하지 않습니다. 만일 제한이 설정된 경우 한계수에 이르게 되면 그 후에 들어오는 연결은 지연됩니다.
confMIN_FREE_BLOCKS
— 서버가 메일을 수용하는데 필요한 최소 여유 블록의 수. 기본값은 100 블록입니다.
confMAX_HEADERS_LENGTH
— 메시지 헤더의 최대 용량 (바이트 단위)
confMAX_MESSAGE_SIZE
— 한 메시지의 최대 용량 (바이트 단위)
/var/spool/mail/
를 NFS 공유 볼륨에 놓지 마십시오.
SECRPC_GSS
커널 모듈이 UID 기반 인증을 사용하지 않으므로 다릅니다. 메일 스풀 디렉토리를 NFS 공유 볼륨에 놓지 마십시오.
/etc/passwd
파일에서 모든 메일 사용자 쉘은 /sbin/nologin
으로 설정하셔야 합니다. (루트 사용자 예외)
netstat -an
또는 lsof -i
와 같은 명령을 입력하여 네트워크 스택을 질의하실 수 있습니다. 이 프로그램은 네트워크의 시스템에 연결하지 않고 시스템 상에 무엇이 실행 중인지 확인하기 때문에 신뢰성이 떨어집니다. 따라서 침입자는 종종 이 프로그램을 상대로 침입을 시도합니다. 침입자가 netstat
및 lsof
를 자신의 수정된 버전으로 교체하여 권한이 없는 네트워크 포트를 열게된 경우 침입한 자취를 감추는데 이러한 방법을 사용합니다.
nmap
과 같은 포트 스캐너를 사용하는 것입니다.
nmap -sT -O localhost
Starting nmap 3.55 ( http://www.insecure.org/nmap/ ) at 2004-09-24 13:49 EDT Interesting ports on localhost.localdomain (127.0.0.1): (The 1653 ports scanned but not shown below are in state: closed) PORT STATE SERVICE 22/tcp open ssh 25/tcp open smtp 111/tcp open rpcbind 113/tcp open auth 631/tcp open ipp 834/tcp open unknown 2601/tcp open zebra 32774/tcp open sometimes-rpc11 Device type: general purpose Running: Linux 2.4.X|2.5.X|2.6.X OS details: Linux 2.5.25 - 2.6.3 or Gentoo 1.2 Linux 2.4.19 rc1-rc7) Uptime 12.857 days (since Sat Sep 11 17:16:20 2004) Nmap run completed -- 1 IP address (1 host up) scanned in 5.190 seconds
sunrpc
서비스가 존재하기 때문에 portmap
을 실행 중인것을 보여줍니다. 그러나 포트 834에서 수상한 서비스를 발견할 수 있습니다. 이 포트가 공식적으로 알려진 서비스와 관계있는지 확인해보시려면 다음 명령을 입력하시기 바랍니다:
cat /etc/services | grep 834
netstat
이나 lsof
를 사용하여 포트에 대한 정보를 확인해보시기 바랍니다. netstat
을 사용하여 포트 834를 확인하시려면 다음 명령을 사용하십시오:
netstat -anp | grep 834
tcp 0 0 0.0.0.0:834 0.0.0.0:* LISTEN 653/ypbind
netstat
을 사용하여 열려진 포트를 발견하시면 이 포트가 안전하다고 안심하실 수 있습니다. 그 이유는 크래커가 침입한 시스템에서 은밀하게 포트를 연 경우에는 이 명령을 사용하여 발견되지 않도록 설정할 것이기 때문에 포트가 열려져 있다는 것은 이 포트가 안전하다는 것을 의미합니다. 또한 [p]
옵션은 포트를 연 서비스의 프로세스 ID (PID)를 보여줍니다. 이 예시에서 열려진 포트는 portmap
서비스와 함께 사용되는 RPC 서비스인 ypbind
(NIS)에 사용됩니다.
lsof
명령도 열려진 포트와 관련된 서비스를 보여주는 기능을 갖추고 있으므로 netstat
와 유사한 정보를 보여줍니다:
lsof -i | grep 834
ypbind 653 0 7u IPv4 1319 TCP *:834 (LISTEN) ypbind 655 0 7u IPv4 1319 TCP *:834 (LISTEN) ypbind 656 0 7u IPv4 1319 TCP *:834 (LISTEN) ypbind 657 0 7u IPv4 1319 TCP *:834 (LISTEN)
lsof
, netstat
, nmap
, services
의 메뉴얼 페이지를 참조하시기 바랍니다.
nss-tools
package loaded.
certutil -A -d /etc/pki/nssdb -n "root ca cert" -t "CT,C,C" \
-i ./ca_cert_in_base64_format.crt
/etc/pam_pkcs11/pam_pkcs11.conf
file, and locate the following line:
enable_ocsp = false;
enable_ocsp = true;
/etc/pam_pkcs11/cn_map
.
cn_map
file:
MY.CAC_CN.123454
-> myloginid
MY.CAC_CN.123454
is the Common Name on your CAC and myloginid
is your UNIX login ID.
pklogin_finder debug
pklogin_finder
tool in debug mode while an enrolled smart card is plugged in, it attempts to output information about the validity of certificates, and if it is successful in attempting to map a login ID from the certificates that are on the card.
about:config
to display the list of current configuration options.
negotiate
to restrict the list of options.
.example.com
.
kinit
to retrieve Kerberos tickets. To display the list of available tickets, type klist
. The following shows an example output from these commands:
~]$kinit
Password for user@EXAMPLE.COM: ~]$klist
Ticket cache: FILE:/tmp/krb5cc_10920 Default principal: user@EXAMPLE.COM Valid starting Expires Service principal 10/26/06 23:47:54 10/27/06 09:47:54 krbtgt/USER.COM@USER.COM renew until 10/26/06 23:47:54 Kerberos 4 ticket cache: /tmp/tkt10920 klist: You have no tickets cached
export NSPR_LOG_MODULES=negotiateauth:5
export NSPR_LOG_FILE=/tmp/moz.log
/tmp/moz.log
, and may give a clue to the problem. For example:
-1208550944[90039d0]: entering nsNegotiateAuth::GetNextToken() -1208550944[90039d0]: gss_init_sec_context() failed: Miscellaneous failure No credentials cache found
kinit
.
kinit
successfully from your machine but you are unable to authenticate, you might see something like this in the log file:
-1208994096[8d683d8]: entering nsAuthGSSAPI::GetNextToken() -1208994096[8d683d8]: gss_init_sec_context() failed: Miscellaneous failure Server not found in Kerberos database
/etc/krb5.conf
file. For example:
.example.com = EXAMPLE.COM example.com = EXAMPLE.COM
/etc/pam.d/
디렉토리에는 각각의 PAM-aware 응용 프로그램에 대한 PAM 설정 파일이 있습니다. 이전 버전의 PAM에는 /etc/pam.conf
파일이 사용되었으나, 현재 이 파일은 삭제되었으며 이는 /etc/pam.d/
디렉토리가 존재하지 않을 경우에만 사용됩니다.
<module interface>
<control flag>
<module name>
<module arguments>
auth
— 이러한 모듈 인터페이스는 사용을 인증합니다. 예를 들어, 이는 암호의 유효성을 요청 및 확인합니다. 이러한 인터페이스를 갖는 모듈은 그룹 멤버쉽이나 커베로스 티켓과 같이 인증을 설정할 수 있습니다.
account
— 이러한 모듈 인터페이스는 액세스를 허용하는 지를 확인합니다. 예를 들어, 사용자 계정이 만료되었는지 또는 특정 시간에 사용자의 로그인이 허용되는지를 확인합니다.
password
— 이러한 모듈 인터페이스는 사용자 암호를 변경하는 데 사용됩니다.
session
— This module interface configures and manages user sessions. Modules with this interface can also perform additional tasks that are needed to allow access, like mounting a user's home directory and making the user's mailbox available.
pam_unix.so
는 네 가지 모듈 인터페이스 모두를 제공합니다.
auth required pam_unix.so
pam_unix.so
module's auth
interface.
reboot
명령은 PAM 설정 파일에서 볼 수 있듯이 스택된 여러 모듈을 사용합니다.
~]# cat /etc/pam.d/reboot
#%PAM-1.0
auth sufficient pam_rootok.so
auth required pam_console.so
#auth include system-auth
account required pam_permit.so
auth sufficient pam_rootok.so
— 이 줄은 pam_rootok.so
모듈을 사용하여 사용자의 UID가 0임을 확인함으로써 사용자가 현재 루트에 있는 지를 확인합니다. 이러한 테스트가 성공적으로 이루어지면, 더이상 다른 모듈이 제시되지 않으며 명령이 실행됩니다. 테스트가 실패할 경우, 다음 모듈이 제시됩니다.
auth required pam_console.so
— 이 줄은 pam_console.so
모듈을 사용하여 사용자 인증을 확인합니다. 사용자가 이미 콘솔에 로그인되어 있을 경우, pam_console.so
파일은 /etc/security/console.apps/
디렉토리에 서비스명과 같은 이름을 가진 파일이 있는 지를 확인합니다 (재부팅). 이러한 파일이 존재할 경우, 성공적으로 인증이 이루어지며 다음 모듈로 제어권이 넘어갑니다.
#auth include system-auth
— 이 줄은 주석으로 실행되지 않습니다.
account required pam_permit.so
— 이 줄은 pam_permit.so
모듈을 사용하여 루트 사용자나 또는 시스템에 재부팅하기 위해 콘솔에 로그인하는 사용자를 허용합니다.
required
— 모듈 결과가 반드시 성공적으로 이루어져야 인증 작업을 계속 진행할 수 있습니다. 이 시점에서 모듈 테스트를 실패할 경우, 인터페이스를 참조하는 모든 모듈 테스트의 결과가 완료될 때 까지 사용자는 인식되지 않게 됩니다.
requisite
— 모듈 결과가 반드시 성공적으로 이루어져야 인증 작업을 계속 진행할 수 있습니다. 하지만, 이 시점에서 모듈 테스트를 실패할 경우, 사용자는 처음으로 실패한 required
또는 requisite
모듈 테스트를 반영하는 메세지와 함께 바로 인식됩니다.
sufficient
— 모듈 테스트를 실패할 경우, 모듈 결과는 무시됩니다. 하지만, sufficient
로 플래그된 모듈의 결과가 성공적으로 이루어지고 required
로 플래그된 이전 모듈이 실패하지 않은 경우, 다른 결과가 필요하지 않게 되며 사용자는 서비스에 인증됩니다.
optional
— 모듈 결과가 무시됩니다. 다른 모듈이 인터페이스를 참조하지 않을 때 optional
로 플래그된 모듈만이 성공적인 인증 작업을 위해 필요합니다.
required
모듈이 호출되는 순서는 중요하지 않습니다. sufficient
및 requisite
제어 플래그만이 순서가 중요하게 됩니다.
pam.d
man page, and the PAM documentation, located in the /usr/share/doc/pam-<version-number>
/
directory, where <version-number>
is the version number for PAM on your system, describe this newer syntax in detail.
/lib64/security/
디렉토리에 있는 64비트 PAM 모듈을 저장할 수 있는 multilib 시스템이 나타나면서, 디렉토리명이 생략되었습니다. 이는 응용 프로그램이 올바른 모듈 버전을 배치할 수 있는 libpam
버전에 링크되기 때문입니다.
pam_userdb.so
모듈은 Berkeley DB 파일에 저장된 정보를 사용하여 사용자를 인증합니다. Berkeley DB는 많은 응용 프로그램에 내장된 오픈 소스 데이터베이스 시스템입니다. 모듈이 db
인자를 갖음으로서 Berkeley DB는 어떤 데이터베이스가 요청된 서비스에 사용되는 지를 알게 됩니다.
pam_userdb.so
line in a PAM configuration. The <path-to-file>
is the full path to the Berkeley DB database file:
auth required pam_userdb.so db=<path-to-file>
/var/log/secure
파일에 오류를 보고합니다.
#%PAM-1.0 auth required pam_securetty.so auth required pam_unix.so nullok auth required pam_nologin.so account required pam_unix.so password required pam_cracklib.so retry=3 password required pam_unix.so shadow nullok use_authtok session required pam_unix.so
#
)로 시작합니다.
auth required pam_securetty.so
— 이 모듈은 사용자가 루트로 로그인하려 할 경우, 사용자가 로그인되어 있는 tty는 파일이 존재할 경우 /etc/securetty
파일 목록에 있게 됩니다.
Login incorrect
메세지와 함께 루트로 로그인을 실패하게 됩니다.
auth required pam_unix.so nullok
— 이 모듈은 사용자에게암호를 요구하며 /etc/passwd
와 /etc/shadow
(이 파일이 존재할 경우)에 저장된 정보를 사용하여 암호를 확인합니다.
pam_unix.so
module automatically detects whether the user's password is in the passwd
file or the shadow
file. Refer to 35.6절. “Shadow Passwords” for more information.
auth required pam_nologin.so
— 마지막 인증 단계로 /etc/nologin
파일이 존재하는 지를 확인합니다. 파일이 존재하고 사용자가 루트에 있지 않을 경우, 인증 실패합니다.
auth
모듈이 실패했지만 세 개의 모든 auth
모듈이 확인되었습니다. 이는 사용자가 어떤 단계에서 자신의 인증이 실패되었는지를 알지 못하게 합니다. 이러한 내용이 침입자의 손에 들어가면 침입자가 시스템에 침입하는 방법을 보다 쉽게 추론하게 할 수 있습니다.
account required pam_unix.so
— 이 모듈은 필요한 계정 확인 작업을 실행합니다. 예를 들어, 쉐도우 암호가 활성화되었을 경우, pam_unix.so
모듈의 계정 인터페이스는 계정이 만료되었는지 또는 사용자가 허용된 유예 기간 안에 암호를 변경하였는지를 확인합니다.
password required pam_cracklib.so retry=3
— 암호가 만료된 경우, pam_cracklib.so
모듈의 암호 구성 요소는 새로운 암호를 만들 것을 요구합니다. 그 후에 새로 생성된 암호에 대해 사전 기반 암호 해킹 프로그램에 의해 쉽게 결정될 수 있는 지를 테스트합니다.
retry=3
인수는 테스트가 처음으로 실패했는 지를 지정하고,사용자에게 강력한 암호를 생성할 수 있는 두 번의 기회가 주어집니다.
password required pam_unix.so shadow nullok use_authtok
— This line specifies that if the program changes the user's password, it should use the password
interface of the pam_unix.so
module to do so.
shadow
instructs the module to create shadow passwords when updating a user's password.
nullok
인수는 모듈을 지시하여 사용자가 공백 암호에서 자신의 암호를 변경할 수 있게 허용합니다. 그렇지 않을 경우, 공백 암호는 계정 잠금으로 다루어 집니다.
use_authtok
는 PAM 모듈을 스택할 때 순서의 중요함을 보여주는 예 입니다. 이러한 인수는 모듈이 사용자에게 새로운 암호를 요구하지 않도록 지시합니다. 대신, 이전 암호 모듈에 의해 기록된 암호중 아무것이나 허용합니다. 이러한 방법에서, 모든 새로운 암호는 암호의 보안을 위해 암호를 허용하기 전pam_cracklib.so
테스트를 거쳐야 합니다.
session required pam_unix.so
— 마지막 줄은 세션을 관리하기 위한 pam_unix.so
모듈의 세션 인터페이스를 지시합니다. 이 모듈은 각 세션의 시작과 마지막에 사용자명과 서비스 유형을 /var/log/secure
에 기록합니다. 이 모듈은 다른 세션 모듈을 사용하여 스택함으로서 추가 기능을 보완할 수 있습니다.
/usr/share/doc/pam-<version-number>
/
directory, where <version-number>
is the version number for PAM on your system.
pam_timestamp.so
모듈을 사용하여 최대 5분 동안 사용자에게 극도의 권한을 제공합니다. pam_timestamp.so
파일이 작동하고 있는 동안 터미널에서 떨어진 사용자가 콘솔로 물리적으로 액세스하려는 누군가에 의한 조작으로 인해 컴퓨터가 열린 채로 있을 수 있으므로 이러한 메카니즘이 어떻게 작동하는 지를 이해하는 것이 중요합니다.
pam_timestamp.so
모듈은 타임스탬프 파일을 생성합니다. 이는 /var/run/sudo/
디렉토리에 기본으로 생성됩니다. 타임스탬프 파일이 이미 존재할 경우, 그래픽 관리자 프로그램은 암호를 요청하지 않고 대신, pam_timestamp.so
모듈은 타임스탬프 파일을 새롭게 하고 사용자를 위해 문제가 되지 않는 관리자 액세스에 대한 5분의 여유 시간을 보유해 둡니다.
/var/run/sudo/<user>
file. For the desktop, the relevant file is unknown:root
. If it is present and its timestamp is less than five minutes old, the credentials are valid.
ssh
를 사용하여 원격으로 시스템에 로그인할 경우, /sbin/pam_timestamp_check -k root
명령을 사용하여 타임스탬프 파일을 삭제합니다.
/sbin/pam_timestamp_check -k root
명령을 실행하셔야합니다.
/sbin/pam_timestamp_check -k
명령을 사용하시려면pam_timestamp.so
모듈을 불러내는 사용자로 로그인하셔야 합니다. 이 명령을 사용하기 위해 루트로 로그인하지 마십시오.
pam_timestamp_check -k root </dev/null >/dev/null 2>/dev/null
pam_timestamp_check
를 사용하여 타임스탬프 파일을 삭제하는 것에 관한 보다 자세한 정보는 pam_timestamp_check
메뉴얼 페이지를 참조하시기 바랍니다.
pam_timestamp.so
모듈은 여러 지시문을 허용합니다. 다음은 가장 일반적으로 사용되는 두 개의 옵션입니다:
timestamp_timeout
— 타임스탬프 파일이 유효한 기간을 (초 단위) 지정합니다. 기본 값은 300초 (5분)입니다.
timestampdir
— 타임스탬프 파일이 저장된 디렉토리를 지정합니다. 기본 값은 /var/run/sudo/
입니다.
pam_timestamp.so
module.
pam_console.so
라고 불리는 PAM 모듈에 의해 제어됩니다.
pam_console.so
모듈은 login
또는 그래픽 로그인 프로그램, gdm, kdm, xdm에 의해 호출됩니다. 이러한 사용자가 물리적 콘솔에 로그인하는 첫 번째 사용자일 경우 — console user로 불려짐 — 모듈은 일반적으로 루트 사용자에 의해 소유되었던 여러 장치의 사용자 소유권이 확장됩니다. 콘솔 사용자는 사용자의 마지막 로컬 세션이 끝날때 까지 이러한 장치를 소유합니다. 이러한 사용자가 로그 아웃한 후, 장치의 소유권은 루트 사용자에게로 복귀됩니다.
pam_console.so
에 의해 제어되는 장치 목록을 수정하실 수 있습니다.
/etc/security/console.perms
/etc/security/console.perms.d/50-default.perms
50-default.perms
파일을 수정하는 대신, 새로운 파일을 생성하시고 (예, xx
-name.perms
) 필요한 사항을 수정하시기 바랍니다. 새로운 기본 파일명은 50 이상의 숫자로 시작해야 합니다. (예, 51-default.perms
) 이는 50-default.perms
파일에 있는 기본값을 덮어 쓰게 됩니다.
<console>
and <xconsole>
directives in the /etc/security/console.perms
to the following values:
<console>=tty[0-9][0-9]* vc/[0-9][0-9]* :0\.[0-9] :0 <xconsole>=:0\.[0-9] :0
<xconsole>
directive entirely and change the <console>
directive to the following value:
<console>=tty[0-9][0-9]* vc/[0-9][0-9]*
/etc/security/console.apps/
디렉토리에서 사용하도록 설정된 특정 프로그램에도 액세스합니다.
/sbin
and /usr/sbin
에 있는 특정 응용 프로그램을 실행할 수 있는 설정 파일이 포함되어 있습니다.
/sbin/halt
/sbin/reboot
/sbin/poweroff
pam_console.so
모듈을 호출합니다.
pam
— PAM 설정 파일에 대한 구조 및 목적을 포함하는 PAM에 관한 개요.
/etc/pam.d/
디렉토리에 있는 /etc/pam.conf
및 개별 설정 파일에 관해 설명하고 있음을 유의하시기 바랍니다. 기본적으로 Red Hat Enterprise Linux에서는 /etc/pam.d/
디렉토리에 있는 개별 설정 파일을 사용하며, /etc/pam.conf
파일이 있을지라도 이를 무시합니다.
pam_console
— pam_console.so
모듈의 목적에 대해 설명하며, PAM 설정 파일 안에 있는 항목에 대한 올바른 구문에 대해서도 설명합니다.
console.apps
— PAM에 의해 할당된 콘솔 사용자가 액세스할 수 있는 응용 프로그램에는 어떤 것이 있는 지를 정의하는 /etc/security/console.apps
설정 파일에서 사용 가능한 포맷 및 옵션에 대해 설명합니다.
console.perms
— PAM에 의해 할당된 콘솔 사용자 허용을 지정하는 /etc/security/console.perms
설정 파일에서 사용 가능한 포맷 및 옵션에 대해 설명합니다.
pam_timestamp
— pam_timestamp.so
모듈에 대해 설명합니다.
/usr/share/doc/pam-<version-number>
— Contains a System Administrators' Guide, a Module Writers' Manual, and the Application Developers' Manual, as well as a copy of the PAM standard, DCE-RFC 86.0, where <version-number>
is the version number of PAM.
/usr/share/doc/pam-<version-number>
/txts/README.pam_timestamp
— Contains information about the pam_timestamp.so
PAM module, where <version-number>
is the version number of PAM.
iptables
-based firewall filters out unwelcome network packets within the kernel's network stack. For network services that utilize it, TCP Wrappers add an additional layer of protection by defining which hosts are or are not allowed to connect to "wrapped" network services. One such wrapped network service is the xinetd
super server. This service is called a super server because it controls connections to a subset of network services and further refines access control.
xinetd
in controlling access to network services and reviews how these tools can be used to enhance both logging and utilization management. Refer to 46.9절. “IPTables” for information about using firewalls with iptables
.
tcp_wrappers
) is installed by default and provides host-based access control to network services. The most important component within the package is the /usr/lib/libwrap.a
library. In general terms, a TCP-wrapped service is one that has been compiled against the libwrap.a
library.
/etc/hosts.allow
and /etc/hosts.deny
) to determine whether or not the client is allowed to connect. In most cases, it then uses the syslog daemon (syslogd
) to write the name of the requesting client and the requested service to /var/log/secure
or /var/log/messages
.
libwrap.a
library. Some such applications include /usr/sbin/sshd
, /usr/sbin/sendmail
, and /usr/sbin/xinetd
.
libwrap.a
, type the following command as the root user:
ldd <binary-name> | grep libwrap
<binary-name>
with the name of the network service binary.
libwrap.a
.
/usr/sbin/sshd
is linked to libwrap.a
:
~]# ldd /usr/sbin/sshd | grep libwrap
libwrap.so.0 => /usr/lib/libwrap.so.0 (0x00655000)
~]#
/etc/hosts.allow
/etc/hosts.deny
/etc/hosts.allow
. — The TCP-wrapped service sequentially parses the /etc/hosts.allow
file and applies the first rule specified for that service. If it finds a matching rule, it allows the connection. If not, it moves on to the next step.
/etc/hosts.deny
. — The TCP-wrapped service sequentially parses the /etc/hosts.deny
file. If it finds a matching rule, it denies the connection. If not, it grants access to the service.
hosts.allow
are applied first, they take precedence over rules specified in hosts.deny
. Therefore, if access to a service is allowed in hosts.allow
, a rule denying access to that same service in hosts.deny
is ignored.
hosts.allow
or hosts.deny
take effect immediately, without restarting network services.
/var/log/messages
or /var/log/secure
. This is also the case for a rule that spans multiple lines without using the backslash character. The following example illustrates the relevant portion of a log message for a rule failure due to either of these circumstances:
warning: /etc/hosts.allow, line 20: missing newline or line too long
/etc/hosts.allow
and /etc/hosts.deny
is identical. Each rule must be on its own line. Blank lines or lines that start with a hash (#) are ignored.
<daemon list>
:<client list>
[:<option>
:<option>
: ...]
<daemon list>
— A comma-separated list of process names (not service names) or the ALL
wildcard. The daemon list also accepts operators (refer to 46.5.2.1.4절. “Operators”) to allow greater flexibility.
<client list>
— A comma-separated list of hostnames, host IP addresses, special patterns, or wildcards which identify the hosts affected by the rule. The client list also accepts operators listed in 46.5.2.1.4절. “Operators” to allow greater flexibility.
<option>
— An optional action or colon-separated list of actions performed when the rule is triggered. Option fields support expansions, launch shell commands, allow or deny access, and alter logging behavior.
vsftpd : .example.com
vsftpd
) from any host in the example.com
domain. If this rule appears in hosts.allow
, the connection is accepted. If this rule appears in hosts.deny
, the connection is rejected.
sshd : .example.com \ : spawn /bin/echo `/bin/date` access denied>>/var/log/sshd.log \ : deny
sshd
) is attempted from a host in the example.com
domain, execute the echo
command to append the attempt to a special log file, and deny the connection. Because the optional deny
directive is used, this line denies access even if it appears in the hosts.allow
file. Refer to 46.5.2.2절. “Option Fields” for a more detailed look at available options.
ALL
— Matches everything. It can be used for both the daemon list and the client list.
LOCAL
— Matches any host that does not contain a period (.), such as localhost.
KNOWN
— Matches any host where the hostname and host address are known or where the user is known.
UNKNOWN
— Matches any host where the hostname or host address are unknown or where the user is unknown.
PARANOID
— Matches any host where the hostname does not match the host address.
KNOWN
, UNKNOWN
, and PARANOID
wildcards should be used with care, because they rely on functioning DNS server for correct operation. Any disruption to name resolution may prevent legitimate users from gaining access to a service.
example.com
domain:
ALL : .example.com
192.168.x.x
network:
ALL : 192.168.
192.168.0.0
through 192.168.1.255
:
ALL : 192.168.0.0/255.255.254.0
3ffe:505:2:1::
through 3ffe:505:2:1:ffff:ffff:ffff:ffff
:
ALL : [3ffe:505:2:1::]/64
example.com
domain:
ALL : *.example.com
/etc/telnet.hosts
file for all Telnet connections:
in.telnetd : /etc/telnet.hosts
hosts_access
man 5 page for more information.
Portmap
's implementation of TCP Wrappers does not support host look-ups, which means portmap
can not use hostnames to identify hosts. Consequently, access control rules for portmap in hosts.allow
or hosts.deny
must use IP addresses, or the keyword ALL
, for specifying hosts.
portmap
access control rules may not take effect immediately. You may need to restart the portmap
service.
portmap
to operate, so be aware of these limitations.
EXCEPT
. It can be used in both the daemon list and the client list of a rule.
EXCEPT
operator allows specific exceptions to broader matches within the same rule.
hosts.allow
file, all example.com
hosts are allowed to connect to all services except cracker.example.com
:
ALL: .example.com EXCEPT cracker.example.com
hosts.allow
file, clients from the 192.168.0.x
network can use all services except for FTP:
ALL EXCEPT vsftpd: 192.168.0.
EXCEPT
operators. This allows other administrators to quickly scan the appropriate files to see what hosts are allowed or denied access to services, without having to sort through EXCEPT
operators.
severity
directive.
example.com
domain are logged to the default authpriv
syslog
facility (because no facility value is specified) with a priority of emerg
:
sshd : .example.com : severity emerg
severity
option. The following example logs any SSH connection attempts by hosts from the example.com
domain to the local0
facility with a priority of alert
:
sshd : .example.com : severity local0.alert
syslogd
) is configured to log to the local0
facility. Refer to the syslog.conf
man page for information about configuring custom log facilities.
allow
or deny
directive as the final option.
client-1.example.com
, but deny connections from client-2.example.com
:
sshd : client-1.example.com : allow sshd : client-2.example.com : deny
hosts.allow
or hosts.deny
. Some administrators consider this an easier way of organizing access rules.
spawn
— Launches a shell command as a child process. This directive can perform tasks like using /usr/sbin/safe_finger
to get more information about the requesting client or create special log files using the echo
command.
example.com
domain are quietly logged to a special file:
in.telnetd : .example.com \ : spawn /bin/echo `/bin/date` from %h>>/var/log/telnet.log \ : allow
twist
— Replaces the requested service with the specified command. This directive is often used to set up traps for intruders (also called "honey pots"). It can also be used to send messages to connecting clients. The twist
directive must occur at the end of the rule line.
example.com
domain are sent a message using the echo
command:
vsftpd : .example.com \ : twist /bin/echo "421 This domain has been black-listed. Access denied!"
hosts_options
man page.
spawn
and twist
directives, provide information about the client, server, and processes involved.
%a
— Returns the client's IP address.
%A
— Returns the server's IP address.
%c
— Returns a variety of client information, such as the username and hostname, or the username and IP address.
%d
— Returns the daemon process name.
%h
— Returns the client's hostname (or IP address, if the hostname is unavailable).
%H
— Returns the server's hostname (or IP address, if the hostname is unavailable).
%n
— Returns the client's hostname. If unavailable, unknown
is printed. If the client's hostname and host address do not match, paranoid
is printed.
%N
— Returns the server's hostname. If unavailable, unknown
is printed. If the server's hostname and host address do not match, paranoid
is printed.
%p
— Returns the daemon's process ID.
%s
—Returns various types of server information, such as the daemon process and the host or IP address of the server.
%u
— Returns the client's username. If unavailable, unknown
is printed.
spawn
command to identify the client host in a customized log file.
sshd
) are attempted from a host in the example.com
domain, execute the echo
command to log the attempt, including the client hostname (by using the %h
expansion), to a special file:
sshd : .example.com \ : spawn /bin/echo `/bin/date` access denied to %h>>/var/log/sshd.log \ : deny
example.com
domain are informed that they have been banned from the server:
vsftpd : .example.com \ : twist /bin/echo "421 %h has been banned from this server!"
hosts_access
(man 5 hosts_access
) and the man page for hosts_options
.
xinetd
daemon is a TCP-wrapped super service which controls access to a subset of popular network services, including FTP, IMAP, and Telnet. It also provides service-specific configuration options for access control, enhanced logging, binding, redirection, and resource utilization control.
xinetd
, the super service receives the request and checks for any TCP Wrappers access control rules.
xinetd
verifies that the connection is allowed under its own access rules for that service. It also checks that the service can have more resources allotted to it and that it is not in breach of any defined rules.
xinetd
then starts an instance of the requested service and passes control of the connection to it. After the connection has been established, xinetd
takes no further part in the communication between the client and the server.
xinetd
are as follows:
/etc/xinetd.conf
— The global xinetd
configuration file.
/etc/xinetd.d/
— The directory containing all service-specific files.
/etc/xinetd.conf
file contains general configuration settings which affect every service under xinetd
's control. It is read when the xinetd
service is first started, so for configuration changes to take effect, you need to restart the xinetd
service. The following is a sample /etc/xinetd.conf
file:
defaults { instances = 60 log_type = SYSLOG authpriv log_on_success = HOST PID log_on_failure = HOST cps = 25 30 } includedir /etc/xinetd.d
xinetd
:
instances
— Specifies the maximum number of simultaneous requests that xinetd
can process.
log_type
— Configures xinetd
to use the authpriv
log facility, which writes log entries to the /var/log/secure
file. Adding a directive such as FILE /var/log/xinetdlog
would create a custom log file called xinetdlog
in the /var/log/
directory.
log_on_success
— Configures xinetd
to log successful connection attempts. By default, the remote host's IP address and the process ID of the server processing the request are recorded.
log_on_failure
— Configures xinetd
to log failed connection attempts or if the connection was denied.
cps
— Configures xinetd
to allow no more than 25 connections per second to any given service. If this limit is exceeded, the service is retired for 30 seconds.
includedir
/etc/xinetd.d/
— Includes options declared in the service-specific configuration files located in the /etc/xinetd.d/
directory. Refer to 46.5.4.2절. “The /etc/xinetd.d/ Directory” for more information.
log_on_success
and log_on_failure
settings in /etc/xinetd.conf
are further modified in the service-specific configuration files. More information may therefore appear in a given service's log file than the /etc/xinetd.conf
file may indicate. Refer to 46.5.4.3.1절. “Logging Options” for further information.
/etc/xinetd.d/
directory contains the configuration files for each service managed by xinetd
and the names of the files correlate to the service. As with xinetd.conf
, this directory is read only when the xinetd
service is started. For any changes to take effect, the administrator must restart the xinetd
service.
/etc/xinetd.d/
directory use the same conventions as /etc/xinetd.conf
. The primary reason the configuration for each service is stored in a separate file is to make customization easier and less likely to affect other services.
/etc/xinetd.d/krb5-telnet
file:
service telnet { flags = REUSE socket_type = stream wait = no user = root server = /usr/kerberos/sbin/telnetd log_on_failure += USERID disable = yes }
telnet
service:
service
— Specifies the service name, usually one of those listed in the /etc/services
file.
flags
— Sets any of a number of attributes for the connection. REUSE
instructs xinetd
to reuse the socket for a Telnet connection.
REUSE
flag is deprecated. All services now implicitly use the REUSE
flag.
socket_type
— Sets the network socket type to stream
.
wait
— Specifies whether the service is single-threaded (yes
) or multi-threaded (no
).
user
— Specifies which user ID the process runs under.
server
— Specifies which binary executable to launch.
log_on_failure
— Specifies logging parameters for log_on_failure
in addition to those already defined in xinetd.conf
.
disable
— Specifies whether the service is disabled (yes
) or enabled (no
).
xinetd.conf
man page for more information about these options and their usage.
xinetd
. This section highlights some of the more commonly used options.
/etc/xinetd.conf
and the service-specific configuration files within the /etc/xinetd.d/
directory.
ATTEMPT
— Logs the fact that a failed attempt was made (log_on_failure
).
DURATION
— Logs the length of time the service is used by a remote system (log_on_success
).
EXIT
— Logs the exit status or termination signal of the service (log_on_success
).
HOST
— Logs the remote host's IP address (log_on_failure
and log_on_success
).
PID
— Logs the process ID of the server receiving the request (log_on_success
).
USERID
— Logs the remote user using the method defined in RFC 1413 for all multi-threaded stream services (log_on_failure
andlog_on_success
).
xinetd.conf
man page.
xinetd
services can choose to use the TCP Wrappers hosts access rules, provide access control via the xinetd
configuration files, or a mixture of both. Refer to 46.5.2절. “TCP Wrappers Configuration Files” for more information about TCP Wrappers hosts access control files.
xinetd
to control access to services.
xinetd
administrator restarts the xinetd
service.
xinetd
only affects services controlled by xinetd
.
xinetd
hosts access control differs from the method used by TCP Wrappers. While TCP Wrappers places all of the access configuration within two files, /etc/hosts.allow
and /etc/hosts.deny
, xinetd
's access control is found in each service's configuration file in the /etc/xinetd.d/
directory.
xinetd
:
only_from
— Allows only the specified hosts to use the service.
no_access
— Blocks listed hosts from using the service.
access_times
— Specifies the time range when a particular service may be used. The time range must be stated in 24-hour format notation, HH:MM-HH:MM.
only_from
and no_access
options can use a list of IP addresses or host names, or can specify an entire network. Like TCP Wrappers, combining xinetd
access control with the enhanced logging configuration can increase security by blocking requests from banned hosts while verbosely recording each connection attempt.
/etc/xinetd.d/telnet
file can be used to block Telnet access from a particular network group and restrict the overall time range that even allowed users can log in:
service telnet { disable = no flags = REUSE socket_type = stream wait = no user = root server = /usr/kerberos/sbin/telnetd log_on_failure += USERID no_access = 172.16.45.0/24 log_on_success += PID HOST EXIT access_times = 09:45-16:15 }
10.0.1.0/24
network, such as 10.0.1.2
, tries to access the Telnet service, it receives the following message:
Connection closed by foreign host.
/var/log/messages
as follows:
Sep 7 14:58:33 localhost xinetd[5285]: FAIL: telnet address from=172.16.45.107 Sep 7 14:58:33 localhost xinetd[5283]: START: telnet pid=5285 from=172.16.45.107 Sep 7 14:58:33 localhost xinetd[5283]: EXIT: telnet status=0 pid=5285 duration=0(sec)
xinetd
access controls, it is important to understand the relationship between the two access control mechanisms.
xinetd
when a client requests a connection:
xinetd
daemon accesses the TCP Wrappers hosts access rules using a libwrap.a
library call. If a deny rule matches the client, the connection is dropped. If an allow rule matches the client, the connection is passed to xinetd
.
xinetd
daemon checks its own access control rules both for the xinetd
service and the requested service. If a deny rule matches the client, the connection is dropped. Otherwise, xinetd
starts an instance of the requested service and passes control of the connection to that service.
xinetd
access controls. Misconfiguration can cause undesirable effects.
xinetd
support binding the service to an IP address and redirecting incoming requests for that service to another IP address, hostname, or port.
bind
option in the service-specific configuration files and links the service to one IP address on the system. When this is configured, the bind
option only allows requests to the correct IP address to access the service. You can use this method to bind different services to different network interfaces based on requirements.
redirect
option accepts an IP address or hostname followed by a port number. It configures the service to redirect any requests for this service to the specified host and port number. This feature can be used to point to another port number on the same system, redirect the request to a different IP address on the same machine, shift the request to a totally different system and port number, or any combination of these options. A user connecting to a certain service on a system may therefore be rerouted to another system without disruption.
xinetd
daemon is able to accomplish this redirection by spawning a process that stays alive for the duration of the connection between the requesting client machine and the host actually providing the service, transferring data between the two systems.
bind
and redirect
options are most clearly evident when they are used together. By binding a service to a particular IP address on a system and then redirecting requests for this service to a second machine that only the first machine can see, an internal system can be used to provide services for a totally different network. Alternatively, these options can be used to limit the exposure of a particular service on a multi-homed machine to a known IP address, as well as redirect any requests for that service to another machine especially configured for that purpose.
service telnet { socket_type = stream wait = no server = /usr/kerberos/sbin/telnetd log_on_success += DURATION USERID log_on_failure += USERID bind = 123.123.123.123 redirect = 10.0.1.13 23 }
bind
and redirect
options in this file ensure that the Telnet service on the machine is bound to the external IP address (123.123.123.123
), the one facing the Internet. In addition, any requests for Telnet service sent to 123.123.123.123
are redirected via a second network adapter to an internal IP address (10.0.1.13
) that only the firewall and internal systems can access. The firewall then sends the communication between the two systems, and the connecting system thinks it is connected to 123.123.123.123
when it is actually connected to a different machine.
xinetd
are configured with the bind
and redirect
options, the gateway machine can act as a proxy between outside systems and a particular internal machine configured to provide the service. In addition, the various xinetd
access control and logging options are also available for additional protection.
xinetd
daemon can add a basic level of protection from Denial of Service (DoS) attacks. The following is a list of directives which can aid in limiting the effectiveness of such attacks:
per_source
— Defines the maximum number of instances for a service per source IP address. It accepts only integers as an argument and can be used in both xinetd.conf
and in the service-specific configuration files in the xinetd.d/
directory.
cps
— Defines the maximum number of connections per second. This directive takes two integer arguments separated by white space. The first argument is the maximum number of connections allowed to the service per second. The second argument is the number of seconds that xinetd
must wait before re-enabling the service. It accepts only integers as arguments and can be used in either the xinetd.conf
file or the service-specific configuration files in the xinetd.d/
directory.
max_load
— Defines the CPU usage or load average threshold for a service. It accepts a floating point number argument.
uptime
, who
, and procinfo
commands for more information about load average.
xinetd
. Refer to the xinetd.conf
man page for more information.
xinetd
is available from system documentation and on the Internet.
xinetd
, and access control.
/usr/share/doc/tcp_wrappers-<version>
/
— This directory contains a README
file that discusses how TCP Wrappers work and the various hostname and host address spoofing risks that exist.
/usr/share/doc/xinetd-<version>
/
— This directory contains a README
file that discusses aspects of access control and a sample.conf
file with various ideas for modifying service-specific configuration files in the /etc/xinetd.d/
directory.
xinetd
-related man pages — A number of man pages exist for the various applications and configuration files involved with TCP Wrappers and xinetd
. The following are some of the more important man pages:
man xinetd
— The man page for xinetd
.
man 5 hosts_access
— The man page for the TCP Wrappers hosts access control files.
man hosts_options
— The man page for the TCP Wrappers options fields.
man xinetd.conf
— The man page listing xinetd
configuration options.
xinetd
, containing sample configuration files, a full listing of features, and an informative FAQ.
xinetd
configuration files to meet specific security goals.
/etc/passwd
또는 /etc/shadow
와 같은 표준 UNIX 암호 데이터베이스에서 사용자 암호를 커베로스 암호 데이터베이스로 옮기는 작업은 아직 자동화되지 않아서 매우 느리고 지루한 작업이 될 수 있습니다. 보다 많은 정보를 원하신다면, 다음 온라인 커베로스 FAQ에서 질문 2.23 번을 참조하시기 바랍니다:
kinit
을 사용하는 대신 keytab 파일에서 가져옵니다. 기본 keytab 파일은 /etc/krb5.keytab
입니다. KDC 관리 서버인 /usr/kerberos/sbin/kadmind
만 유일하게 다른 파일인 /var/kerberos/krb5kdc/kadm5.keytab
파일을 사용합니다.
kinit
명령은 이미 로그인한 주 멤버가 초기 티켓 부여 티켓 (TGT)을 받아서 캐시할 수 있도록 해줍니다. kinit
명령 사용에 대한 보다 많은 정보를 원하신다면 메뉴얼 페이지를 참조하시기 바랍니다.
root[/instance]@REALM
. For a typical user, the root is the same as their login ID. The instance
is optional. If the principal has an instance, it is separated from the root with a forward slash ("/"). An empty string ("") is considered a valid instance (which differs from the default NULL
instance), but using it can be confusing. All principals in a realm have their own key, which for users is derived from a password or is randomly set for services.
kinit
프로그램에 의해 전달될 수 도 있습니다.
kinit
program on the client then decrypts the TGT using the user's key, which it computes from the user's password. The user's key is used only on the client machine and is not transmitted over the network.
ntpd
. Refer to /usr/share/doc/ntp-<version-number>
/index.html
for details on setting up Network Time Protocol servers (where <version-number>
is the version number of the ntp
package installed on your system).
/usr/share/doc/krb5-server-<version-number>
for more information (where <version-number>
is the version number of the krb5-server
package installed on your system).
pam_krb5
패키지에 포함된) pam_krb5
모듈이 설치된 경우 커베로스를 사용하여 인증 작업을 수행할 수 있습니다. pam_krb5
패키지에는 사용자를 인증하고 사용자의 암호를 사용하여 초기 인증 정보를 가져오는 login
과 gdm
과 같은 서비스를 가능하게 해주는 샘플 설정 파일이 포함되어 있습니다. 만일 커베로스를 사용하는 서비스나 IMAP과 같은 GSS-API를 사용하는 서비스만 사용하여 네트워크 서버를 사용한다면, 네트워크가 상당히 안전하다고 간주됩니다.
ntp
package for this purpose. Refer to /usr/share/doc/ntp-<version-number>
/index.html
(where <version-number>
is the version number of the ntp
package installed on your system) for details about how to set up Network Time Protocol servers, and http://www.ntp.org for more information about NTP.
krb5-libs
, krb5-server
, ="none">krb5-workstation
패키지를 설치하시기 바랍니다. 이 기계는 매우 안전해야 합니다 — 만일 가능하다면, KDC가 아닌 다른 서비스는 실행하지 않는 것이 좋습니다.
/etc/krb5.conf
설정 파일과 /var/kerberos/krb5kdc/kdc.conf
설정 파일을 편집하십시오. EXAMPLE.COM
과 example.com
— 반드시 대문자와 소문자를 올바른 형식으로 유지하셔야 합니다 — 을 도메인명으로 대체하고 KDC를 kerberos.example.com
에서 케베로스 서버 이름으로 변경하여 쉽게 단순 영역명을 생성하실 수 있습니다. 일반적으로 모든 영역명은 대문자이며 모든 DNS 호스트명과 도메인 이름은 소문자입니다. 이러한 파일 형식에 대한 보다 자세한 정보는 각 메뉴얼 페이지를 참조하시기 바랍니다.
kdb5_util
유틸리티를 사용하여 데이터베이스를 생성하십시오:
/usr/kerberos/sbin/kdb5_util create -s
create
명령은 여러분의 커베로스 영역에 사용되는 키를 저장할 데이터베이스를 생성합니다. -s
스위치 옵션은 마스터 서버 키 파일이 저장될 숨은 (stash) 파일을 생성하게 합니다. 키를 읽어올 숨은 파일이 존재하지 않는다면, 커베로스 서버 (krb5kdc
)는 매번 시작할 때마다 사용자에게 (키를 재생성하는데 사용되는) 마스터 서버 암호를 입력하도록 요구할 것입니다.
/var/kerberos/krb5kdc/kadm5.acl
파일을 수정하시기 바랍니다. kadmind
명령은 이 파일을 사용하여 어느 주 멤버가 커베로스 데이터베이스에 관리 권한을 가지고 있는지와 그 권한 수준을 알아냅니다. 대부분의 경우 다음 한 줄만 입력하시면 됩니다:
*/admin@EXAMPLE.COM *
kadmind
가 서버에서 시작되면, 어느 사용자든 커베로스 영역 내 어느 클라이언트나 서버 상에서 kadmin
을 실행하여 서비스를 사용할 수 있습니다. 그러나 kadm5.acl
파일 목록에 포함된 사용자만이 자신의 암호를 변경하는 작업을 제외하고는 어떠한 방식으로든 데이터베이스를 수정할 수 있습니다.
kadmin
유틸리티는 네트워크 상에서 kadmind
서버와 통신을 주고 받으며, 커베로스를 사용하여 인증을 처리합니다. 따라서 네트워크 상에서 서버를 관리하기 위하여 서버에 연결하기 전에 첫번째 주 멤버를 생성하셔야 합니다. kadmin.local
명령을 사용하여 첫번째 주 멤버를 생성하시기 바랍니다. 이 명령은 KDC가 실행되는 동일한 호스트에서만 사용되도록 고안되었으며 인증을 위해 커베로스를 사용하지 않습니다.
kadmin.local
명령을 입력하여 첫번째 주 멤버를 생성하시기 바랍니다:
/usr/kerberos/sbin/kadmin.local -q "addprinc username
/admin"
service krb5kdc start
service kadmin start
service krb524 start
kadmin
명령과 함께 addprinc
명령을 사용하여 사용자를 위한 주 멤버를 추가하시기 바랍니다. kadmin
과 kadmin.local
는 KDC에 대한 명령행 인터페이스입니다. 따라서 kadmin
프로그램을 시작 후 많은 명령어 — 예: addprinc
—를 사용 가능합니다. 보다 많은 정보를 원하신다면, kadmin
메뉴얼 페이지를 참조하시기 바랍니다.
kinit
명령을 실행하여 티켓을 받아 증명 캐시 파일에 보관합니다. 다음으로 캐시 파일에서 인증 목록을 살펴 보시려면 klist
명령을 사용하시고, 캐시와 그 캐시가 포함한 인증 정보를 삭제하시려면 kdestroy
명령을 사용하시기 바랍니다.
kinit
attempts to authenticate using the same system login username (not the Kerberos server). If that username does not correspond to a principal in the Kerberos database, kinit
issues an error message. If that happens, supply kinit
with the name of the correct principal as an argument on the command line (kinit <principal>
).
krb5.conf
configuration file. While ssh
and slogin
are the preferred method of remotely logging in to client systems, Kerberized versions of rsh
and rlogin
are still available, though deploying them requires that a few more configuration changes be made.
krb5-libs
와krb5-workstation
패키지를 설치해 주십시오. 각 클라이언트마다 유효한 /etc/krb5.conf
파일을 입력해 주셔야 합니다 (일반적으로 이 파일은 KDC에 의해 사용되는 krb5.conf
파일과 동일합니다).
ssh
or Kerberized rsh
or rlogin
, it must have its own host principal in the Kerberos database. The sshd
, kshd
, and klogind
server programs all need access to the keys for the host service's principal. Additionally, in order to use the kerberized rsh
and rlogin
services, that workstation must have the xinetd
package installed.
kadmin
, add a host principal for the workstation on the KDC. The instance in this case is the hostname of the workstation. Use the -randkey
option for the kadmin
's addprinc
command to create the principal and assign it a random key:
addprinc -randkey host/blah.example.com
kadmin
명령에 ktadd
명령을 함께 사용하여 워크스테이션에 사용될 키를 가져올 수 있습니다:
ktadd -k /etc/krb5.keytab host/blah.example.com
ssh
— OpenSSH uses GSS-API to authenticate users to servers if the client's and server's configuration both have GSSAPIAuthentication
enabled. If the client also has GSSAPIDelegateCredentials
enabled, the user's credentials are made available on the remote system.
rsh
와 rlogin
— 커베로스를 사용하는 버전의 rsh
와 rlogin
을 사용하기 위해서는, klogin
, eklogin
, kshell
을 활성화하셔야 합니다.
krb5-telnet
을 활성화하십시오.
ftp
의 루트로서 주 멤버의 키를 생성하신 후 가져오셔야 합니다. FTP 서버의 완전한 호스트명 (fully qualified hostname)에 인스턴스를 잊지말고 설정하신 후 gssftp
를 활성화하시기 바랍니다.
cyrus-sasl-gssapi
패키지기 설치되어 있을 경우 cyrus-imap
패키지는 Kerberos 5를 사용합니다. cyrus-sasl-gssapi
패키지에는 GSS-API 인증을 지원하는 Cyrus SASL이 포함되어 있습니다. Cyrus IMAP는 cyrus
사용자가 /etc/krb5.keytab
에서 올바른 키를 찾을 수 있고, 주 멤버의 루트(root)가 (kadmin
와 함께 생성된) imap
에 설정되어 있는 한 커베로스와 함께 올바르게 작동해야 합니다.
cyrus-imap
can be found in the dovecot
package, which is also included in Red Hat Enterprise Linux. This package contains an IMAP server but does not, to date, support GSS-API and Kerberos.
gserver
는 cvs
를 루트로 가진 주 멤버를 사용합니다. 이 점만 제외하고는 CVS pserver
와 동일합니다.
foo.example.org → EXAMPLE.ORG
foo.example.com → EXAMPLE.COM
foo.hq.example.com → HQ.EXAMPLE.COM
krb5.conf
. For example:
[domain_realm] .example.com = EXAMPLE.COM example.com = EXAMPLE.COM
kadmind
(it is also your realm's admin server), and one or more KDCs (slave KDCs) keep read-only copies of the database and run kpropd
.
krb5.conf
and kdc.conf
files are copied to the slave KDC.
kadmin.local
from a root shell on the master KDC and use its add_principal
command to create a new entry for the master KDC's host service, and then use its ktadd
command to simultaneously set a random key for the service and store the random key in the master's default keytab file. This key will be used by the kprop
command to authenticate to the slave servers. You will only need to do this once, regardless of how many slave servers you install.
~]#kadmin.local -r EXAMPLE.COM
Authenticating as principal root/admin@EXAMPLE.COM with password. kadmin:add_principal -randkey host/masterkdc.example.com
Principal "host/host/masterkdc.example.com@EXAMPLE.COM" created. kadmin:ktadd host/masterkdc.example.com
Entry for principal host/masterkdc.example.com with kvno 3, encryption type Triple DES cbc mode with \ HMAC/sha1 added to keytab WRFILE:/etc/krb5.keytab. Entry for principal host/masterkdc.example.com with kvno 3, encryption type ArcFour with HMAC/md5 \ added to keytab WRFILE:/etc/krb5.keytab. Entry for principal host/masterkdc.example.com with kvno 3, encryption type DES with HMAC/sha1 added \ to keytab WRFILE:/etc/krb5.keytab. Entry for principal host/masterkdc.example.com with kvno 3, encryption type DES cbc mode with RSA-MD5 \ added to keytab WRFILE:/etc/krb5.keytab. kadmin:quit
kadmin
from a root shell on the slave KDC and use its add_principal
command to create a new entry for the slave KDC's host service, and then use kadmin
's ktadd
command to simultaneously set a random key for the service and store the random key in the slave's default keytab file. This key is used by the kpropd
service when authenticating clients.
~]#kadmin -p jimbo/admin@EXAMPLE.COM -r EXAMPLE.COM
Authenticating as principal jimbo/admin@EXAMPLE.COM with password. Password for jimbo/admin@EXAMPLE.COM: kadmin:add_principal -randkey host/slavekdc.example.com
Principal "host/slavekdc.example.com@EXAMPLE.COM" created. kadmin:ktadd host/slavekdc.example.com@EXAMPLE.COM
Entry for principal host/slavekdc.example.com with kvno 3, encryption type Triple DES cbc mode with \ HMAC/sha1 added to keytab WRFILE:/etc/krb5.keytab. Entry for principal host/slavekdc.example.com with kvno 3, encryption type ArcFour with HMAC/md5 added \ to keytab WRFILE:/etc/krb5.keytab. Entry for principal host/slavekdc.example.com with kvno 3, encryption type DES with HMAC/sha1 added \ to keytab WRFILE:/etc/krb5.keytab. Entry for principal host/slavekdc.example.com with kvno 3, encryption type DES cbc mode with RSA-MD5 added \ to keytab WRFILE:/etc/krb5.keytab. kadmin:quit
kprop
service with a new realm database. To restrict access, the kprop
service on the slave KDC will only accept updates from clients whose principal names are listed in /var/kerberos/krb5kdc/kpropd.acl
. Add the master KDC's host service's name to that file.
~]# echo host/masterkdc.example.com@EXAMPLE.COM > /var/kerberos/krb5kdc/kpropd.acl
/var/kerberos/krb5kdc/.k5.REALM
, either copy it to the slave KDC using any available secure method, or create a dummy database and identical stash file on the slave KDC by running kdb5_util create -s
(the dummy database will be overwritten by the first successful database propagation) and supplying the same password.
kprop
service. Then, double-check that the kadmin
service is disabled.
kprop
command will read (/var/kerberos/krb5kdc/slave_datatrans
), and then use the kprop
command to transmit its contents to the slave KDC.
~]#/usr/kerberos/sbin/kdb5_util dump /var/kerberos/krb5kdc/slave_datatrans
~]#kprop slavekdc.example.com
kinit
, verify that a client system whose krb5.conf
lists only the slave KDC in its list of KDCs for your realm is now correctly able to obtain initial credentials from the slave KDC.
kprop
command to transmit the database to each slave KDC in turn, and configure the cron
service to run the script periodically.
A.EXAMPLE.COM
to access a service in the B.EXAMPLE.COM
realm, both realms must share a key for a principal named krbtgt/B.EXAMPLE.COM@A.EXAMPLE.COM
, and both keys must have the same key version number associated with them.
~]#kadmin -r A.EXAMPLE.COM
kadmin:add_principal krbtgt/B.EXAMPLE.COM@A.EXAMPLE.COM
Enter password for principal "krbtgt/B.EXAMPLE.COM@A.EXAMPLE.COM": Re-enter password for principal "krbtgt/B.EXAMPLE.COM@A.EXAMPLE.COM": Principal "krbtgt/B.EXAMPLE.COM@A.EXAMPLE.COM" created. kadmin:quit
~]#kadmin -r B.EXAMPLE.COM
kadmin:add_principal krbtgt/B.EXAMPLE.COM@A.EXAMPLE.COM
Enter password for principal "krbtgt/B.EXAMPLE.COM@A.EXAMPLE.COM": Re-enter password for principal "krbtgt/B.EXAMPLE.COM@A.EXAMPLE.COM": Principal "krbtgt/B.EXAMPLE.COM@A.EXAMPLE.COM" created. kadmin:quit
get_principal
command to verify that both entries have matching key version numbers (kvno
values) and encryption types.
add_principal
command's -randkey
option to assign a random key instead of a password, dump the new entry from the database of the first realm, and import it into the second. This will not work unless the master keys for the realm databases are identical, as the keys contained in a database dump are themselves encrypted using the master key.
A.EXAMPLE.COM
realm are now able to authenticate to services in the B.EXAMPLE.COM
realm. Put another way, the B.EXAMPLE.COM
realm now trusts the A.EXAMPLE.COM
realm, or phrased even more simply, B.EXAMPLE.COM
now trusts A.EXAMPLE.COM
.
B.EXAMPLE.COM
realm may trust clients from the A.EXAMPLE.COM
to authenticate to services in the B.EXAMPLE.COM
realm, but the fact that it does has no effect on whether or not clients in the B.EXAMPLE.COM
realm are trusted to authenticate to services in the A.EXAMPLE.COM
realm. To establish trust in the other direction, both realms would need to share keys for the krbtgt/A.EXAMPLE.COM@B.EXAMPLE.COM
service (take note of the reversed in order of the two realms compared to the example above).
A.EXAMPLE.COM
can authenticate to services in B.EXAMPLE.COM
, and clients from B.EXAMPLE.COM
can authenticate to services in C.EXAMPLE.COM
, then clients in A.EXAMPLE.COM
can also authenticate to services in C.EXAMPLE.COM
, even if C.EXAMPLE.COM
doesn't directly trust A.EXAMPLE.COM
. This means that, on a network with multiple realms which all need to trust each other, making good choices about which trust relationships to set up can greatly reduce the amount of effort required.
service/server.example.com@EXAMPLE.COM
EXAMPLE.COM
is the name of the realm.
domain_realm
section of /etc/krb5.conf
to map either a hostname (server.example.com) or a DNS domain name (.example.com) to the name of a realm (EXAMPLE.COM).
A.EXAMPLE.COM
, B.EXAMPLE.COM
, and EXAMPLE.COM
. When a client in the A.EXAMPLE.COM
realm attempts to authenticate to a service in B.EXAMPLE.COM
, it will, by default, first attempt to get credentials for the EXAMPLE.COM
realm, and then to use those credentials to obtain credentials for use in the B.EXAMPLE.COM
realm.
A.EXAMPLE.COM
, authenticating to a service in B.EXAMPLE.COM
:
A.EXAMPLE.COM → EXAMPLE.COM → B.EXAMPLE.COM
A.EXAMPLE.COM
and EXAMPLE.COM
share a key for krbtgt/EXAMPLE.COM@A.EXAMPLE.COM
EXAMPLE.COM
and B.EXAMPLE.COM
share a key for krbtgt/B.EXAMPLE.COM@EXAMPLE.COM
SITE1.SALES.EXAMPLE.COM
, authenticating to a service in EVERYWHERE.EXAMPLE.COM
:
SITE1.SALES.EXAMPLE.COM → SALES.EXAMPLE.COM → EXAMPLE.COM → EVERYWHERE.EXAMPLE.COM
SITE1.SALES.EXAMPLE.COM
and SALES.EXAMPLE.COM
share a key for krbtgt/SALES.EXAMPLE.COM@SITE1.SALES.EXAMPLE.COM
SALES.EXAMPLE.COM
and EXAMPLE.COM
share a key for krbtgt/EXAMPLE.COM@SALES.EXAMPLE.COM
EXAMPLE.COM
and EVERYWHERE.EXAMPLE.COM
share a key for krbtgt/EVERYWHERE.EXAMPLE.COM@EXAMPLE.COM
DEVEL.EXAMPLE.COM
and PROD.EXAMPLE.ORG
):
DEVEL.EXAMPLE.COM → EXAMPLE.COM → COM → ORG → EXAMPLE.ORG → PROD.EXAMPLE.ORG
DEVEL.EXAMPLE.COM
and EXAMPLE.COM
share a key for krbtgt/EXAMPLE.COM@DEVEL.EXAMPLE.COM
EXAMPLE.COM
and COM
share a key for krbtgt/COM@EXAMPLE.COM
COM
and ORG
share a key for krbtgt/ORG@COM
ORG
and EXAMPLE.ORG
share a key for krbtgt/EXAMPLE.ORG@ORG
EXAMPLE.ORG
and PROD.EXAMPLE.ORG
share a key for krbtgt/PROD.EXAMPLE.ORG@EXAMPLE.ORG
capaths
section of /etc/krb5.conf
, so that clients which have credentials for one realm will be able to look up which realm is next in the chain which will eventually lead to the being able to authenticate to servers.
capaths
section is relatively straightforward: each entry in the section is named after a realm in which a client might exist. Inside of that subsection, the set of intermediate realms from which the client must obtain credentials is listed as values of the key which corresponds to the realm in which a service might reside. If there are no intermediate realms, the value "." is used.
[capaths] A.EXAMPLE.COM = { B.EXAMPLE.COM = . C.EXAMPLE.COM = B.EXAMPLE.COM D.EXAMPLE.COM = B.EXAMPLE.COM D.EXAMPLE.COM = C.EXAMPLE.COM }
A.EXAMPLE.COM
realm can obtain cross-realm credentials for B.EXAMPLE.COM
directly from the A.EXAMPLE.COM
KDC.
C.EXAMPLE.COM
realm, they will first need to obtain necessary credentials from the B.EXAMPLE.COM
realm (this requires that krbtgt/B.EXAMPLE.COM@A.EXAMPLE.COM
exist), and then use those
credentials to obtain credentials for use in the C.EXAMPLE.COM
realm (using krbtgt/C.EXAMPLE.COM@B.EXAMPLE.COM
).
D.EXAMPLE.COM
realm, they will first need to obtain necessary credentials from the B.EXAMPLE.COM
realm, and then credentials from the C.EXAMPLE.COM
realm, before finally obtaining credentials for use with the D.EXAMPLE.COM
realm.
A.EXAMPLE.COM
realm can obtain cross-realm credentials from B.EXAMPLE.COM
realm directly. Without the "." indicating this, the client would instead attempt to use a hierarchical path, in this case:
A.EXAMPLE.COM → EXAMPLE.COM → B.EXAMPLE.COM
/usr/share/doc/krb5-server-<version-number>
/
directory (where <version-number>
is the version number of the krb5-server
package installed on your system).
/usr/share/doc/krb5-workstation-<version-number>
/
directory (where <version-number>
is the version number of the krb5-workstation
package installed on your system).
man kerberos
— 커베로스 시스템에 대한 소개. 증명(credentials)이 작동하는 방법 및 커베로스 티켓을 획득하고 제거하는 방법에 대하여 설명합니다. 메뉴얼 페이지 마지막 부분을 보시면 다른 관련 메뉴얼 페이지가 나와 있습니다.
man kinit
— 이 명령을 사용하여 티켓 부여 티켓(TGT)을 획득하고 캐시하는 방법을 설명합니다.
man kdestroy
— 이 명령을 사용하여 커베로스 인증을 제거하는 방법을 설명합니다.
man klist
— 이 명령을 사용하여 캐시 저장된 커베로스 인증 목록을 보는 방법을 설명합니다.
man kadmin
— 이 명령을 사용하여 커베로스 V5 데이터베이스를 관리하는 방법을 설명합니다.
man kdb5_util
— 이 명령을 사용하여 커베로스 V5 데이터베이스에 저수준 관리 기능을 생성하고 실행하는 방법을 설명합니다.
man krb5kdc
— 커베로스 V5 키 배포 센터에 사용되는 명령행 옵션을 보여줍니다.
man kadmind
— 커베로스 V5 관리 서버에 사용되는 명령행 옵션을 보여줍니다.
man krb5.conf
— 커베로스 V5 라이브러리에 사용되는 설정 파일 내에서 사용 가능한 형식과 옵션을 설명합니다.
man krb5.conf
— 커베로스 V5 AS 및 KDC에 사용되는 설정 파일 내에서 사용 가능한 형식과 옵션을 설명합니다.
racoon
키 관리 데몬이 IKE 키를 배포하고 교환합니다. 이러한 데몬에 관한 보다 자세한 정보는 racoon
메뉴얼 페이지를 참조하시기 바랍니다.
ipsec-tools
RPM 패키지가 설치되어 있어야 합니다. 이 RPM 패키지에는 IPsec 연결을 설정하는데 필요한 라이브러리, 데몬 및 설정 파일이 포함되어 있습니다. 패키지 내용물은 다음과 같습니다:
/sbin/setkey
— 커널에서 키 관리와 IPsec의 보안 속성을 조정합니다. 이 실행 파일은 racoon
키 관리 데몬에 의해 조정됩니다. setkey
에 대한 보다 자세한 정보는 setkey
(8) 메뉴얼 페이지를 참조하시기 바랍니다.
/usr/sbin/racoon
— the IKE key management daemon, used to manage and control security associations and key sharing between IPsec-connected systems.
/etc/racoon/racoon.conf
— racoon
데몬 설정 파일으로서 연결에 사용된 인증 방법 및 암호화 알고리즘을 포함한 다양한 측면의 IPsec 연결을 설정하는데 사용됩니다. 사용 가능한 모든 지시자 목록을 보시려면 racoon.conf
(5) 메뉴얼 페이지를 참조하시기 바랍니다.
system-config-network
를 입력하여 Network Administration Tool: 네트워크 관리 도구를 시작합니다.
ipsec0
. If required, select the check box to automatically activate the connection when the computer starts. Click to continue.
racoon
데몬이 암호화키를 관리합니다. 자동 암호화를 사용하실 경우, ipsec-tools
패키지가 설치되어 있어야 합니다.
ifconfig <device>
<device>
is the Ethernet device that you want to use for the VPN connection.
eth0 Link encap:Ethernet HWaddr 00:0C:6E:E8:98:1D inet addr:172.16.44.192 Bcast:172.16.45.255 Mask:255.255.254.0
inet addr:
레이블 다음에 오는 숫자입니다.
service network restart
/etc/sysconfig/network-scripts/ifcfg-<nickname>
/etc/sysconfig/network-scripts/keys-<nickname>
/etc/racoon/<remote-ip>
.conf
/etc/racoon/psk.txt
/etc/racoon/racoon.conf
역시 생성됩니다.
/etc/racoon/racoon.conf
is modified to include <remote-ip>
.conf
.
ipsec1
과 같은 고유 이름. 이는 IPsec 연결을 식별하고 다른 장치나 연결에서 이를 구별하기 위해 사용됩니다.
racoon
에 의해 자동으로 생성된 암호키
Key_Value01
의 값을 이미 공유된 키로 사용하여 연결하고자 하며, 양 사용자가 racoon
데몬이 자동으로 인증키를 생성하여 각 호스트 간에 공유하는 것에 동의하여 이 연결을 ipsec1
으로 이름 붙였다고 가정합니다.
ipsec1
이므로 결과적으로 파일 이름은 /etc/sysconfig/network-scripts/ifcfg-ipsec1
이 됩니다.
DST=X.X.X.X
TYPE=IPSEC
ONBOOT=no
IKE_METHOD=PSK
X.X.X.X
부분을 워크스테이션 B의 IP 주소로 대체하고, 워크스테이션 B는 X.X.X.X
를 워크스테이션 A의 IP 주소로 대체합니다. 이 연결은 부팅시 시작되도록 (ONBOOT=no
) 설정되지 않았으며 이미 공유된 키 인증 방식 (IKE_METHOD=PSK
)을 사용합니다.
/etc/sysconfig/network-scripts/keys-ipsec1
)의 내용입니다. 이 파일은 양 워크스테이션이 상대방을 인증하는데 필요합니다. 이 파일의 내용은 양 컴퓨터에서 동일해야 하며 루트 사용자만이 이 파일을 읽거나 수정할 수 있습니다.
IKE_PSK=Key_Value01
keys-ipsec1
파일을 루트 사용자만 읽고 수정할 수 있도록 하시려면, 파일을 만드신 후 다음 명령을 입력하십시오:
chmod 600 /etc/sysconfig/network-scripts/keys-ipsec1
keys-ipsec1
파일을 수정하시면 됩니다. 양 키가 동일해야만 제대로 연결할 수 있습니다.
X.X.X.X
.conf
입니다 (여기서 X.X.X.X
는 원격 IPsec 호스트의 IP 주소로 대체하십시오). 이 파일은 IPsec 터널이 활성화되면 자동으로 생성되기 때문에 직접 수정하시면 안됩니다.
remote X.X.X.X
{
exchange_mode aggressive, main;
my_identifier address;
proposal {
encryption_algorithm 3des;
hash_algorithm sha1;
authentication_method pre_shared_key;
dh_group 2 ;
}
}
X.X.X.X
X.X.X.X
인 원격 컴퓨터에만 적용하도록 지정합니다.
/etc/racoon/racoon.conf
files should be identical on all IPsec nodes except for the include "/etc/racoon/X.X.X.X
.conf"
statement. This statement (and the file it references) is generated when the IPsec tunnel is activated. For Workstation A, the X.X.X.X
in the include
statement is Workstation B's IP address. The opposite is true of Workstation B. The following shows a typical racoon.conf
file when the IPsec connection is activated.
# Racoon IKE daemon configuration file. # See 'man racoon.conf' for a description of the format and entries. path include "/etc/racoon"; path pre_shared_key "/etc/racoon/psk.txt"; path certificate "/etc/racoon/certs"; sainfo anonymous { pfs_group 2; lifetime time 1 hour ; encryption_algorithm 3des, blowfish 448, rijndael ; authentication_algorithm hmac_sha1, hmac_md5 ; compression_algorithm deflate ; } include "/etc/racoon/X.X.X.X.conf";
racoon.conf
파일에는 IPsec 설정, 기존 공유 키 파일 및 인증서의 지정된 경로가 포함됩니다. sainfo anonymous
항목은 IPsec 컴퓨터 간 2 단계 SA — IPsec 연결 속성 (사용된 암호화 알고리즘 포함) 및 키 교환 방식을 설명합니다. 다음은 2 단계 항목을 정의하는 목록입니다:
modp1024
)를 사용하여 IPsec을 구현합니다. 그룹 2는 1024 비트 방식을 사용하기 때문에 침입자가 비밀키를 알아낸 경우에도 이전 IPsec 전송 내용을 암호 해독 불가능합니다.
ifup <nickname>
tcpdump
utility to view the network packets being transferred between the hosts and verify that they are encrypted via IPsec. The packet should include an AH header and should be shown as ESP packets. ESP means it is encrypted. For example:
~]# tcpdump -n -i eth0 host <targetSystem>
IP 172.16.45.107 > 172.16.44.192: AH(spi=0x0954ccb6,seq=0xbb): ESP(spi=0x0c9f2164,seq=0xbb)
ipsec1
과 같은 고유 이름. 이는 IPsec 연결을 식별하고 다른 장치나 연결에서 이를 구별하기 위해 사용됩니다.
racoon
에 의해 자동으로 생성된 암호키
system-config-network
를 입력하여 Network Administration Tool: 네트워크 관리 도구를 시작합니다.
ipsec0
. If required, select the check box to automatically activate the connection when the computer starts. Click to continue.
racoon
데몬이 암호화키를 관리합니다. 자동 암호화를 사용하실 경우, ipsec-tools
패키지가 설치되어 있어야 합니다.
192.168.1.0
을 입력하고, ipsec0 설정하는 경우 192.168.2.0
을 입력합니다.
/etc/sysctl.conf
and set net.ipv4.ip_forward
to 1
.
sysctl -p /etc/sysctl.conf
r3dh4tl1nux
을 이미 공유된 키로 사용하며 A와 B의 관리자가 racoon
데몬이 자동으로 인증키를 생성하고 각 IPsec 라우터 간에 인증키를 공유하도록 동의했다고 가정합니다. LAN A의 관리자는 IPsec 연결을 ipsec0
이라 이름 붙인 반면 LANB의 관리자는 IPsec 연결을 ipsec1
이라고 이름 붙였습니다.
ifcfg
파일의 내용을 보여줍니다. 이 예시에서 이 연결을 식별하기 위해 사용된 고유 이름은 ipsec0
입니다, 따라서 결과적으로 파일 이름은 /etc/sysconfig/network-scripts/ifcfg-ipsec0
이 됩니다.
TYPE=IPSEC
ONBOOT=yes
IKE_METHOD=PSK
SRCGW=192.168.1.254
DSTGW=192.168.2.254
SRCNET=192.168.1.0/24
DSTNET=192.168.2.0/24
DST=X.X.X.X
/etc/sysconfig/network-scripts/keys-ipsecX
기존 공유 키 파일 (여기서 X
는 LAN A의 경우 0이며 LAN B는 1 입니다)의 내용으로서 이 파일은 양 네트워크가 상대방을 인증하는데 사용됩니다. 이 파일의 내용은 두 네트워크에서 동일해야 하며 루트 사용자만이 이 파일을 읽거나 작성할 수 있습니다.
IKE_PSK=r3dh4tl1nux
keys-ipsecX
파일을 루트 사용자만 읽고 수정할 수 있도록 설정하시려면, 파일을 생성 후 다음 명령을 입력합니다:
chmod 600 /etc/sysconfig/network-scripts/keys-ipsec1
keys-ipsecX
파일을 수정합니다. 반드시 양 키가 같아야 제대로 연결됩니다.
/etc/racoon/racoon.conf
설정 파일입니다. 파일 마지막 부분의 include
부분은 자동으로 생성되며 IPsec 터널이 실행된 경우에만 나타납니다.
# Racoon IKE daemon configuration file.
# See 'man racoon.conf' for a description of the format and entries.
path include "/etc/racoon";
path pre_shared_key "/etc/racoon/psk.txt";
path certificate "/etc/racoon/certs";
sainfo anonymous
{
pfs_group 2;
lifetime time 1 hour ;
encryption_algorithm 3des, blowfish 448, rijndael ;
authentication_algorithm hmac_sha1, hmac_md5 ;
compression_algorithm deflate ;
}
include "/etc/racoon/X.X.X.X
.conf"
X.X.X.X
.conf
이며 여기서 X.X.X.X
를 원격 IPsec 라우터의 IP 주소로 대체합니다. 이 파일은 IPsec 터널이 활성화되면 자동으로 생성되기 때문에 직접 수정하시면 안됩니다.
remote X.X.X.X
{
exchange_mode aggressive, main;
my_identifier address;
proposal {
encryption_algorithm 3des;
hash_algorithm sha1;
authentication_method pre_shared_key;
dh_group 2 ;
}
}
/etc/sysctl.conf
and set net.ipv4.ip_forward
to 1
.
sysctl -p /etc/sysctl.conf
ifup ipsec0
ifup
을 실행하여 호출된 초기화 스크립트에 의해 라우트가 자동으로 생성됩니다. 네트워크 상 라우트 목록을 보시려면, 다음 명령을 실행합니다:
ip route list
tcpdump
utility on the externally-routable device (eth0 in this example) to view the network packets being transferred between the hosts (or networks), and verify that they are encrypted via IPsec. For example, to check the IPsec connectivity of LAN A, use the following command:
tcpdump -n -i eth0 host lana.example.com
12:24:26.155529 lanb.example.com > lana.example.com: AH(spi=0x021c9834,seq=0x358): \ lanb.example.com > lana.example.com: ESP(spi=0x00c887ad,seq=0x358) (DF) \ (ipip-proto-4)
ifup <nickname>
<nickname>
is the nickname configured earlier, such as ipsec0
.
ifdown <nickname>
방법 | 설명 | 장점 | 단점 | ||||||
---|---|---|---|---|---|---|---|---|---|
NAT | Network Address Translation (NAT) places private IP subnetworks behind one or a small pool of public IP addresses, masquerading all requests to one source rather than several. The Linux kernel has built-in NAT functionality through the Netfilter kernel subsystem. |
|
| ||||||
패킷 필터 | A packet filtering firewall reads each data packet that passes through a LAN. It can read and process packets by header information and filters the packet based on sets of programmable rules implemented by the firewall administrator. The Linux kernel has built-in packet filtering functionality through the Netfilter kernel subsystem. |
|
| ||||||
프록시 | 프록시 방화벽은 LAN 클라이언트로부터 프록시 기계로 들어오는 모든 요청에서 특정 프로토콜이나 유형을 걸러낸 후 이러한 유형을 로컬 클라이언트를 대신하여 인터넷에 보냅니다. 프록시 기계는 악의를 가진 원격 사용자와 내부 네트워크 클라이언트 기계 사이에서 버퍼로 작동합니다. |
|
|
iptables
tool.
iptables
administration tool, a command line tool similar in syntax to its predecessor, ipchains
.
ipchains
requires intricate rule sets for: filtering source paths; filtering destination paths; and filtering both source and destination connection ports.
iptables
uses the Netfilter subsystem to enhance network connection, inspection, and processing. iptables
features advanced logging, pre- and post-routing actions, network address translation, and port forwarding, all in one command line interface.
iptables
. For more detailed information, refer to 46.9절. “IPTables”.
system-config-securitylevel
iptables
rules.
/etc/sysconfig/iptables
file. If you choose Disabled and click , these configurations and firewall rules will be lost.
httpd
package be installed.
vsftpd
package be installed.
openssh-server
package be installed.
telnet-server
package be installed.
fetchmail
. To allow delivery of mail to your machine, select this check box. Note that an improperly configured SMTP server can allow remote machines to use your server to send spam.
iptables
. For example, to allow IRC and Internet printing protocol (IPP) to pass through the firewall, add the following to the Other ports section:
194:tcp,631:tcp
iptables
commands and written to the /etc/sysconfig/iptables
file. The iptables
service is also started so that the firewall is activated immediately after saving the selected options. If Disable firewall was selected, the /etc/sysconfig/iptables
file is removed and the iptables
service is stopped immediately.
/etc/sysconfig/system-config-securitylevel
file so that the settings can be restored the next time the application is started. Do not edit this file by hand.
iptables
service is not configured to start automatically at boot time. Refer to 46.8.2.6절. “Activating the IPTables Service” for more information.
iptables
service is running. To manually start the service, use the following command:
service iptables restart
iptables
starts when the system is booted, use the following command:
chkconfig --level 345 iptables on
ipchains
service is not included in Red Hat Enterprise Linux. However, if ipchains
is installed (for example, an upgrade was performed and the system had ipchains
previously installed), the ipchains
and iptables
services should not be activated simultaneously. To make sure the ipchains
service is disabled and configured not to start at boot time, use the following two commands:
service ipchains stop
chkconfig --level 345 ipchains off
iptables
is to start the iptables
service. Use the following command to start the iptables
service:
service iptables start
ip6tables
service can be turned off if you intend to use the iptables
service only. If you deactivate the ip6tables
service, remember to deactivate the IPv6 network also. Never leave a network device active without the matching firewall.
iptables
to start by default when the system is booted, use the following command:
chkconfig --level 345 iptables on
iptables
to start whenever the system is booted into runlevel 3, 4, or 5.
iptables
command illustrates the basic command syntax:
iptables -A <chain>
-j <target>
-A
option specifies that the rule be appended to <chain>. Each chain is comprised of one or more rules, and is therefore also known as a ruleset.
-j <target>
option specifies the target of the rule; i.e., what to do if the packet matches the rule. Examples of built-in targets are ACCEPT, DROP, and REJECT.
iptables
man page for more information on the available chains, options, and targets.
iptables
chain is comprised of a default policy, and zero or more rules which work in concert with the default policy to define the overall ruleset for the firewall.
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
iptables
are transitory; if the system is rebooted or if the iptables
service is restarted, the rules are automatically flushed and reset. To save the rules so that they are loaded when the iptables
service is started, use the following command:
service iptables save
/etc/sysconfig/iptables
and are applied whenever the service is started or the machine is rebooted.
iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
iptables
ruleset, order is important.
-I
option. For example:
iptables -I INPUT 1 -i lo -p all -j ACCEPT
iptables
to accept connections from remote SSH clients. For example, the following rules allow remote SSH access:
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 22 -j ACCEPT
iptables
filtering rules.
FORWARD
and NAT Rulesiptables
provides routing and forwarding policies that can be implemented to prevent abnormal usage of network resources.
FORWARD
chain allows an administrator to control where packets can be routed within a LAN. For example, to allow forwarding for the entire LAN (assuming the firewall/gateway is assigned an internal IP address on eth1), use the following rules:
iptables -A FORWARD -i eth1 -j ACCEPT
iptables -A FORWARD -o eth1 -j ACCEPT
eth1
device.
sysctl -w net.ipv4.ip_forward=1
/etc/sysctl.conf
file as follows:
net.ipv4.ip_forward = 0
net.ipv4.ip_forward = 1
sysctl.conf
file:
sysctl -p /etc/sysctl.conf
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
-t nat
) and specifies the built-in POSTROUTING chain for NAT (-A POSTROUTING
) on the firewall's external networking device (-o eth0
).
-j MASQUERADE
target is specified to mask the private IP address of a node with the external IP address of the firewall/gateway.
-j DNAT
target of the PREROUTING chain in NAT to specify a destination IP address and port where incoming packets requesting a connection to your internal service can be forwarded.
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to 172.31.0.23:80
iptables -A FORWARD -i eth0 -p tcp --dport 80 -d 172.31.0.23 -j ACCEPT
iptables
rules to route traffic to certain machines, such as a dedicated HTTP or FTP server, in a demilitarized zone (DMZ). A DMZ is a special local subnetwork dedicated to providing services on a public carrier, such as the Internet.
PREROUTING
table to forward the packets to the appropriate destination:
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to-destination 10.0.4.2:80
iptables -A OUTPUT -o eth0 -p tcp --dport 31337 --sport 31337 -j DROP
iptables -A FORWARD -o eth0 -p tcp --dport 31337 --sport 31337 -j DROP
iptables -A FORWARD -s 192.168.1.0/24 -i eth0 -j DROP
DROP
and REJECT
targets when dealing with appended rules.
REJECT
target denies access and returns a connection refused
error to users who attempt to connect to the service. The DROP
target, as the name implies, drops the packet without any warning.
REJECT
target is recommended.
iptables
uses a method called connection tracking to store information about incoming connections. You can allow or deny access based on the following connection states:
NEW
— 새로운 연결을 요청하는 패킷, 예, HTTP 요청
ESTABLISHED
— 기존 연결의 일부인 패킷
RELATED
— A packet that is requesting a new connection but is part of an existing connection. For example, FTP uses port 21 to establish a connection, but data is transferred on a different port (typically port 20).
INVALID
— 연결 추적표에서 어디 연결에도 속하지 않은 패킷.
iptables
connection tracking with any network protocol, even if the protocol itself is stateless (such as UDP). The following example shows a rule that uses connection tracking to forward only the packets that are associated with an established connection:
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
ip6tables
command. In Red Hat Enterprise Linux 5, both IPv4 and IPv6 services are enabled by default.
ip6tables
command syntax is identical to iptables
in every aspect except that it supports 128-bit addresses. For example, use the following command to enable SSH connections on an IPv6-aware network server:
ip6tables -A INPUT -i eth0 -p tcp -s 3ffe:ffff:100::1/128 --dport 22 -j ACCEPT
iptables
command, including definitions for many command options.
iptables
man page contains a brief summary of the various options.
iptables
project.
iptables
. It includes topics that cover analyzing firewall logs, developing firewall rules, and customizing your firewall using various graphical tools.
ipchains
as well as Netfilter and iptables
. Additional security topics such as remote access issues and intrusion detection systems are also covered.
ipchains
에 의존하며 필터링 과정의 각각의 단계에서 패킷에 적용되는 규칙 목록을 사용합니다. 커널 2.4버전에서는 iptables
(넷필터(netfilter)라고도 부름)를 소개하고 있으며, 이는 ipchains
와 비슷하지만 범위을 확장하여 네트워크 패킷 필터링을 할 수 있는 제어 기능을 갖고 있습니다.
ipchains
와 iptables
의 다른점에 대해 알아보며, iptables
명령을 가지고 사용 가능한 다양한 옵션과 시스템 재부팅에서 필터링 규칙이 어떻게 보존되는지에 대해 설명합니다.
iptables
rules and setting up a firewall based on these rules.
iptables
이지만, ipchains
이 이미 실행되고 있을 경우, iptables
는 사용될 수 없습니다. ipchains
가 부팅할 때에 나타나면, 커널은 오류를 발생하며 iptables
를 시작할 수 없게 됩니다.
ipchains
의 기능은 이러한 오류에 의해 영향을 받지 않습니다.
filter
— 네트워크 패킷을 다루기 위한 기본 테이블.
nat
— 새로운 연결을 생성하는 패킷을 변경하기 위해 사용되며 네트워크 주소 변환 (Network Address Translation) (NAT)을 위해 사용됨.
mangle
— 특정 유형의 패킷 변경을 위해 사용됨.
netfilter
에 의한 패킷에서 실행되는 작업에 해당합니다.
filter
테이블에 대한 내장된 chains은 다음과 같습니다:
nat
테이블에 해당하는 내장된 chains은 다음과 같습니다:
mangle
테이블에 해당하는 내장된 chains은 다음과 같습니다:
/etc/sysconfig/iptables
또는 /etc/sysconfig/ip6tables
파일에 저장되었습니다.
iptables
서비스는 Linux 시스템이 부팅할 때 DNS 관련 서비스 이전에 시작합니다. 이는 방화벽 규칙이 숫자로된 IP 주소 (예:192.168.0.1)만을 참조할 수 있다는 것을 의미합니다. 도메인 명 (예: host.example.com)은 이러한 규칙에서 오류를 발생합니다.
ACCEPT
target for a matching packet, the packet skips the rest of the rule checks and is allowed to continue to its destination. If a rule specifies a DROP
target, that packet is refused access to the system and nothing is sent back to the host that sent the packet. If a rule specifies a QUEUE
target, the packet is passed to user-space. If a rule specifies the optional REJECT
target, the packet is dropped, but an error packet is sent to the packet's originator.
ACCEPT
, DROP
, REJECT
, 또는 QUEUE
에 기본 정책을 가지고 있습니다. chain에 있는 규칙 중 어느 것도 패킷에 적용되지 않을 경우, 패킷은 기본 정책에 따라 다루어 집니다.
iptables
명령은 이러한 테이블을 설정하며, 필요한 경우 새로운 테이블을 설정하기도 합니다.
ipchains
과 iptables
는 특정 규칙이나 규칙 모음에 일치하는 가에 따라 패킷을 필터하기 위해 Linux 커널안에서 작동하는 규칙의 chains을 사용합니다. 하지만, iptables
는 관리자가 시스템에 지나친 복잡성을 구축하지 않고 제어하게 하는 패킷을 필터링하는 확장가능한 방법을 제공합니다.
ipchains
와 iptables
의 다른점을 확인해 보시기 바랍니다:
iptables
, each filtered packet is processed using rules from only one chain rather than multiple chains. ipchains
를 사용한 시스템으로 들어오는 FORWARD 패킷은 수신지에 도달하기 위해 INPUT, FORWARD, OUTPUT chain을 통과하게 됩니다. 하지만, iptables
는 패킷의 수신지가 로컬 시스템일 경우 패킷을 INPUT chain으로만 보내며, 로컬 시스템이 패킷을 생성했을 경우 패킷을 OUTPUT chain으로만 보냅니다. 따라서 실제적으로 패킷을 다루는 chain 안에서 특정 패킷을 감지하도록 규칙을 고안해야 합니다.
ipchains
에서, chain에 있는 규칙과 일치하는 패킷은 거부 (DENY) 대상이 됩니다. 이러한 대상은 iptables
에서 취소 (DROP) 대상으로 변경되어야 합니다.
ipchains
에서 규칙 옵션의 순서는 중요하지 않습니다.
iptables
명령은 엄격한 구문을 가집니다. iptables
명령은 발생지 포트 또는 수신지 포트 이전에 프로토콜 (ICMP, TCP, 또는 UDP)을 지정할 것을 요구합니다.
-i
옵션) INPUT 또는 FORWARD chain에서만 사용될 수 있습니다. 이와 비슷하게, 나가는 인터페이스는 (-o
옵션) FORWARD 또는 OUTPUT chain에서만 사용될 수 있습니다.
iptables
명령을 사용하여 생성됩니다. 주로 다음과 같은 패킷 내용이 기준으로서 사용됩니다.
iptables
규칙과 함께 사용되는 옵션은 사용 가능한 규칙에 대한 모든 규칙의 목적 및 조건에 기반하여 논리적으로 그룹지어져야만 합니다. 이 장의 나머지 부분에서는 iptables
명령에 해당하는 일반적으로 사용되는 옵션에 대해 설명합니다.
iptables
명령은 다음과 같은 구조를 가지고 있습니다:
iptables [-t<table-name>
]<command>
<chain-name>
\<parameter-1>
<option-1>
\<parameter-n>
<option-n>
<table-name>
— Specifies which table the rule applies to. If omitted, the filter
table is used.
<command>
— Specifies the action to perform, such as appending or deleting a rule.
<chain-name>
— Specifies the chain to edit, create, or delete.
<parameter>-<option>
pairs — Parameters and associated options that specify how to process a packet that matches the rule.
iptables
명령의 길이 및 복잡성은 목적에 따라 현저하게 변경될 수 있습니다.
iptables -D <chain-name> <line-number>
iptables
명령을 구축할 때, 몇몇 매개 변수와 옵션은 유효한 규칙을 구축하기 위해 추가 매개 변수 및 옵션을 요구한다는 점을 기억해두시기 바랍니다. 이는 더 많은 매개변수를 요구하는 추가 매개 변수와 함께 캐스캐이딩(cascading) 효과를 창출할 수 있습니다. 다른 옵션을 요구하는 모든 매개변수 및 옵션을 만족시킬때 까지, 규칙은 유효하지 않게 됩니다.
iptables -h
를 입력하여 iptables
명령 구조의 종합적인 목록을 봅니다.
iptables
를 사용합니다. 하나의 명령 옵션에 하나의 iptables
명령만이 허용됩니다. 도움말 명령을 제외하고 모든 명령은 대문자로 쓰여져 있습니다.
iptables
명령은 다음과 같습니다:
-A
— 특정 chain의 마지막에 규칙을 추가합니다. 아래에 설명된 -I
옵션과는 달리, 이는 정수 인자를 갖지 않으며, 항상 특정 chain의 마지막에 규칙을 추가합니다.
-C
— 사용자 지정 chain에 특정 규칙을 추가하기 전에 이를 확인합니다. 이러한 명령은 추가 매개 변수와 옵션을 요구하여 복잡한 iptables
규칙을 구성하게 할 수 있습니다.
-D <integer> | <rule>
— Deletes a rule in a particular chain by number (such as 5
for the fifth rule in a chain), or by rule specification. The rule specification must exactly match an existing rule.
-E
— 사용자 정의된 chain의 이름을 변경합니다. 사용자 정의된 chain은 기본값이 아닌 기존의 모든 chain입니다. (사용자 정의된 chain의 생성에 관한 자세한 정보는 아래의 -N
옵션을 참조하시기 바랍니다.) 이는 표면적인 변경 사항으로 테이블의 구조에 아무런 영향을 미치지 않습니다.
Match not found
오류를 보고하여, 기본 chain의 이름을 변경하실 수 없게 됩니다.
-F
— 선택한 chain을 삭제합니다, 이는 실제적으로 chain에 있는 모든 규칙을 삭제하게 됩니다. 어떤 chain도 지정되어 있지 않을 경우,이 명령은 모든 chain에 있는 모든 규칙을 삭제합니다.
-h
— 명령 구조 목록과 명령 매개 변수 및 옵션의 요약 설명을 제공합니다.
-I [<integer>]
— Inserts the rule in the specified chain at a point specified by a user-defined integer argument. If no argument is specified, the rule is inserted at the top of the chain.
-A
또는 -I
옵션을 사용하여 규칙을 추가할 때 중요합니다.
-I
옵션을 사용하여 규칙을 추가할 때 중요합니다. chain에 규칙을 추가할 때 기존의 숫자를 지정하신 경우, iptables
명령은 기존의 규칙 이전에 (또는 위에) 새로운 규칙을 추가합니다.
-L
— 명령 이후에 지정된 chain에 있는 모든 규칙의 목록을 만듭니다. 기본 filter
테이블의 모든 chain에 있는 모든 규칙의 목록을 만들기 위해, chain이나 테이블을 지정하지 마십시오. 그렇지 않으면, 특정 테이블의 특정 chain에 있는 규칙의 목록을 만드는데 다음의 구문을 사용해야 합니다.
iptables -L <chain-name>
-t <table-name>
-L
command option, which provide rule numbers and allow more verbose rule descriptions, are described in 46.9.3.6절. “옵션 목록”.
-N
— 사용자 정의된 이름과 함께 새로운 chain을 생성합니다. 고유한 chain 명이 아닐 경우 오류 메세지가 나타납니다.
-P
— 특정 chain에 대해 기본 정책을 설정하여, 패킷이 규칙에 일치하지 않고 chain을 관통하게 되면, 허용 (ACCEPT) 또는 취소 (DROP)와 같은 특정 목표 규칙을 보내게 됩니다.
-R
— Replaces a rule in the specified chain. The rule's number must be specified after the chain's name. The first rule in a chain corresponds to rule number one.
-X
— 사용자 정의된 chain을 삭제합니다. 내장된 chain을 삭제하실 수 는 없습니다.
-Z
— 바이트를 설정하고 테이블에 대한 모든 chain에 있는 패킷 카운터를 0까지 설정합니다.
iptables
명령은 패킷 필터링 규칙을 구성하기 위해 다양한 매개 변수를 필요로 합니다.
-c
— 특정 규칙에 대해 카운터를 재설정합니다. 이러한 매개 변수는 어떤 카운터를 재설정할 지를 지정하기 위해 PKTS
및 BYTES
옵션을 허용합니다.
-d
— 수신지의 호스트명, IP 주소, 또는 규칙에 일치하는 패킷의 네트워크를 설정합니다. 네트워크에 일치할 때, 다음의 IP 주소/넷마스크 형식이 지원됩니다:
N.N.N.N
/M.M.M.M
— N.N.N.N
는 IP 주소 영역이며 M.M.M.M
는 넷마스크에 해당합니다.
N.N.N.N
/M
— N.N.N.N
는 IP 주소 영역이며 M
는 비트마스크(bitmask)에 해당합니다.
-f
— 이러한 규칙은 분리된 패킷에만 적용됩니다.
!
) 옵션을 사용합니다.
-i
— eth0
또는 ppp0
와 같이 들어오는 네트워크 인터페이스를 설정합니다. iptables
명령을 가지고, 이러한 매개 변수 옵션은 nat
및 mangle
테이블과 함께 filter
테이블과 PREROUTING chain을 사용할 때 INPUT과 FORWARD chain을 사용할 수 도 있습니다.
!
) — 지시 사항을 바꾸어, 의미있는 특정 인터페이스를 이러한 규칙에서 제외합니다.
+
) — 특정 문자열에 일치하는 인터페이스를 일치시키기 위해 사용되는 와일드카드 문자. 예를 들어, 매개 변수 -i eth+
는 이러한 규칙을 이더넷 인터페이스에 적용시킬 수 있지만, ppp0
와 같은 다른 인터페이스는 여기서 제외됩니다.
-i
매개 변수가 사용되었지만 어떤 인터페이스도 지정되지 않았을 경우, 모든 인터페이스는 이러한 규칙의 영향을 받게 됩니다.
-j
— 패킷이 특정 규칙에 일치할 때 지정된 대상으로 이동합니다.
ACCEPT
, DROP
, QUEUE
, RETURN
입니다.
iptables
RPM 패키지를 사용하여 기본값으로 읽어진 모듈을 통해 사용하실 수 있습니다. 이러한 모듈에 있는 유효한 대상에는 LOG
, MARK
, REJECT
, 등이 포함됩니다. 이러한 대상에 대한 보다 자세한 정보는 iptables
메뉴얼 페이지에서 참조하시기 바랍니다.
-o
— 규칙에 대하여 나가는 네트워크 인터페이스를 설정합니다. 이러한 옵션은 filter
테이블에 있는 OUTPUT 및 FORWARD chain과 nat
및 mangle
테이블에 있는 POSTROUTING chain에 대해서만 유효합니다. 이러한 매개 변수는 들어오는 네트워크 인터페이스 매개 변수 (-i
)와 같은 옵션을 허용합니다.
-p <protocol>
— Sets the IP protocol affected by the rule. This can be either icmp
, tcp
, udp
, or all
, or it can be a numeric value, representing one of these or a different protocol. You can also use any protocols listed in the /etc/protocols
file.
all
" protocol means the rule applies to every supported protocol. If no protocol is listed with this rule, it defaults to "all
".
-s
— 수신지 (-d
) 매개 변수와 같은 구문을 사용하여 특정 패킷에 대한 소스를 설정합니다.
iptables
command. For example, -p <protocol-name>
enables options for the specified protocol. Note that you can also use the protocol ID, instead of the protocol name. Refer to the following examples, each of which have the same effect:
iptables -A INPUT -p icmp --icmp-type any -j ACCEPT
iptables -A INPUT -p 5813 --icmp-type any -j ACCEPT
/etc/services
파일에 있습니다. 가독성을 위해, 포트 번호를 사용하는 데신 서비스명을 사용하실 것을 권장합니다.
/etc/services
파일을 보호합니다. 이 파일을 편집하는 것이 가능하게 될 경우, 침입자는 사용자가 연결을 끊어야 하는 사용자의 컴퓨터에 있는 포트를 활성화할 수 있습니다. 이 파일의 보안을 위해 root 계정으로 다음의 명령을 입력하시기 바랍니다:
chown root.root /etc/services
chmod 0644 /etc/services
chattr +i /etc/services
-p tcp
)을 위해 사용가능합니다:
--dport
— 패킷을 위해 수신지 포트를 설정합니다.
:
). 예: -p tcp --dport 3000:3200
. 사용할 수 있는 유효한 최대 범위는 0:65535
입니다.
--dport
옵션 뒤에 느낌표 기호 (!
)를 사용합니다.
/etc/services
파일을 확인합니다.
--destination-port
일치 옵션은 --dport
와 의미가 같습니다.
--sport
— --dport
와 같은 옵션을 사용하여 패킷의 소스 포트를 설정합니다. --source-port
일치 옵션은 --sport
와 의미가 같습니다.
--syn
— 일반적으로 SYN 패킷이라고 불리우는, 통신을 초기화하기 위해 고안된 모든 TCP 패킷에 적용합니다. 데이터 페이로드(payload)를 전송하는 패킷에는 적용되지 않습니다.
--syn
옵션 뒤에 느낌표 기호 (!
)를 사용합니다.
--tcp-flags <tested flag list> <set flag list>
— Allows TCP packets that have specific bits (flags) set, to match a rule.
--tcp-flags
일치 옵션은 두개의 매개 변수를 허용합니다. 첫 번째 매개 변수는 마스크로 패킷에서 검사하기 위해 콤마로 구분되는 플래그 목록입니다. 두번째 매개 변수는 규칙을 일치시키시 위해 설정되야 하는 콤마로 구분되는 플래그 목록입니다.
ACK
FIN
PSH
RST
SYN
URG
ALL
NONE
iptables
규칙은 SYN 플래그 모음을 갖고 있는 TCP 패킷에 일치하며 ACK 및 FIN 플래그는 설정되지 않았습니다:
--tcp-flags ACK,FIN,SYN SYN
--tcp-flags
뒤에 느낌표 부호 (!
)를 사용합니다.
--tcp-option
— 특정 패킷 안에서 설정할 수 있는 TCP-특정 옵션과 일치시키려 합니다. 이러한 일치 옵션은 느낌표 부호 (!
)를 사용하여 바꿀수 도 있습니다.
-p udp
)에 대해 사용가능 합니다:
--dport
— 서비스명, 포트 번호, 또는 포트 번호의 영역을 사용하여, UDP 패킷의 수신지 포트를 지정합니다. --destination-port
일치 옵션은 --dport
와 의미가 같습니다.
--sport
— 서비스명, 포트 번호, 또는 포트 번호의 영역을 사용하여, UDP 패킷의 소스 포트를 지정합니다. --source-port
일치 옵션은 --sport
와 의미가 같습니다.
--dport
및 --sport
옵션으로 포트 번호의 영역을 지정하고 콜론 (:)을 사용하여 두 번호를 구별합니다. 예: -p tcp --dport 3000:3200
. 허용된 유효한 최대 영역은 0:65535입니다.
-p icmp
)에 대해 사용 가능합니다:
--icmp-type
— 규칙과 일치하는 ICMP 유형의 이름이나 번호를 설정합니다. 사용가능한 ICMP 이름 목록은 iptables -p icmp -h
명령을 입력하여 검색하실 수 있습니다.
iptables
명령으로 불러온 모듈을 통해 사용하실 수 있습니다.
-m <module-name>
, where <module-name>
is the name of the module.
limit
모듈 — 얼마나 많은 패킷을 특정 규칙에 일치하게 할지에 제한을 둡니다.
LOG
대상과 함께 사용할 때, limit
모듈은 여러 일치하는 패킷을 반복되는 메세지가 있는 시스템 로그로 채우거나 시스템 리소스를 사용하지 못하게 합니다.
LOG
target.
limit
모듈은 다음과 같은 옵션을 활성화합니다:
--limit
— Sets the maximum number of matches for a particular time period, specified as a <value>/<period>
pair. For example, using --limit 5/hour
allows five rule matches per hour.
3/hour
의 기본값이 사용될 것입니다.
--limit-burst
— 한번에 규칙에 일치하는 패킷의 수에 제한을 둡니다.
--limit
옵션과 함께 사용하셔야 합니다.
state
모듈 — 상태 일치를 활성화합니다.
state
모듈은 다음과 같은 옵션을 활성화합니다:
--state
— 패킷을 다음의 연결 상태와 일치시킵니다:
ESTABLISHED
— 일치 패킷은 기존 연결에 있는 다른 패킷과 관련되어 있습니다. 클라이언트와 서버 사이의 연결을 유지하시기를 원하실 경우, 이를 허용하셔야 합니다.
INVALID
— 일치 패킷은 알려진 연결에 묶어질 수 없습니다.
NEW
— 일치 패킷은 새로운 연결을 생성하거나 또는 이전에 볼 수 없었던 양방향 연결의 일부분이 될 수 있습니다. 서비스에 새로운 연결을 허용하시려면 이를 허용하셔야 합니다.
RELATED
— 일치 패킷은 기존 연결과 관련하여 새로운 연결을 시작합니다. 이에 대한 예로 FTP가 있으며, 이는 소통량 제어 (포트 21)를 위해 하나의 연결을 사용하며, 데이터 전송 (포트 20)과 분리된 연결을 사용합니다.
-m state --state INVALID,NEW
와 같이 콤마로 구분하여 서로 함께 사용될 수 있습니다.
mac
모듈 — 하드웨어 MAC 주소 일치를 활성화합니다.
mac
모듈은 다음의 옵션을 활성화합니다:
--mac-source
— 패킷을 보낸 네트워크 인터페이스 카드의 MAC 주소에 일치시킵니다. 규칙에서 MAC 주소를 제외시키기 위해, --mac-source
일치 옵션 뒤에 느낌표 기호 (!
)를 입력합니다.
iptables
메뉴얼 페이지에서 참조하시기 바랍니다.
<user-defined-chain>
— A user-defined chain within the table. User-defined chain names must be unique. This target passes the packet to the specified chain.
ACCEPT
— 패킷의 수신지 또는 다른 chain을 통과하는 패킷을 허용합니다.
DROP
— 요청에 응답하지 않고 패킷을 취소합니다. 패킷을 보낸 시스템은 이러한 실패를 통보하지 않습니다.
QUEUE
— 패킷은 사용자 공간 프로그램으로 처리되기 위해 대기합니다.
RETURN
— 현재 chain에 있는 규칙에 대해 패킷을 확인하는 것을 중지합니다. RETURN
대상과 함께 패킷이 다른 chain에서 불려진 chain에 있는 규칙에 일치할 경우, 패킷은 확인이 중지된 곳에서 규칙을 조사하기 위해 첫 번째 chain으로 복귀합니다. RETURN
규칙이 내장된 chain에서 사용되고 패킷을 이전 chain으로 이동시킬 수 없을 경우, 현재 chain의 기본 대상이 사용됩니다.
LOG
— 이러한 규칙에 일치하는 모든 패킷을 기록합니다. 패킷이 커널에 의해 기록되므로, /etc/syslog.conf
파일은 이러한 로그 항목이 기록되는 장소를 결정합니다. 이는 기본값으로 /var/log/messages
파일에 위치하게 됩니다.
LOG
대상 뒤에 추가 옵션이 사용될 수 있습니다.
--log-level
— 기록하는 작업에 대한 우선 순위를 설정합니다. 우선 순위 목록에 대한 정보는 syslog.conf
메뉴얼 페이지에서 참조하시기 바랍니다.
--log-ip-options
— IP 패킷의 헤더에 설정된 모든 옵션을 기록합니다.
--log-prefix
— 로그 행이 기록되기 전에 최대 29개로된 문자열을 만듭니다. 이는 syslog 필터의 기록을 위해 패킷 기록과 함께 사용하는 것이 유용합니다.
log-prefix
값에 공백을 추가하셔야 합니다.
--log-tcp-options
— TCP 패킷의 헤더에 설정된 모든 옵션을 기록합니다.
--log-tcp-sequence
— 로그에 있는 패킷에 해당하는 TCP 순서 번호를 기록합니다.
REJECT
— 오류 패킷을 원격 시스템에 되돌려 보내고 패킷을 취소합니다.
REJECT
target accepts --reject-with <type>
(where <type>
is the rejection type) allowing more detailed information to be returned with the error packet. The message port-unreachable
is the default error type given if no other option is used. Refer to the iptables
man page for a full list of <type>
options.
nat
테이블을 사용하는 IP 매스커레이딩이나 또는 mangle
테이블을 사용하는 패킷 변경에 유용한 여러 기능을 포함하는 대상 확장기능은 iptables
메뉴얼 페이지에서 확인하실 수 있습니다.
iptables -L [<chain-name>]
, provides a very basic overview of the default filter table's current chains. Additional options provide more information:
-v
— 각각의 chain에서 실행되는 패킷과 바이트의 수, 각각의 규칙과 일치하는 패킷과 바이트의 수, 그리고 어떤 인터페이스가 특정 규칙에 적용되는가와 같은 상세한 출력을 보여줍니다.
-x
— 패킷과 바이트 숫자를 정확한 값으로 확장합니다. 복잡한 시스템에서는 특정 chain이나 규칙에 의해 실행되는 패킷과 바이트의 수는 Kilobytes
,Megabytes
(Megabytes) 또는 Gigabytes
로 단축됩니다. 이러한 옵션은 전체 숫자가 나타나도록 강제합니다.
-n
— 기본 호스트명 및 네트워크 서비스 포맷이 아닌 숫자로된 포맷에서 IP 주소와 포트 번호를 보여줍니다.
--line-numbers
— chain에 있는 숫자로된 순서 옆의 각각의 chain에 있는 규칙 목록을 만듭니다. 이러한 옵션은 chain에 있는 특정 규칙을 삭제하거나 또는 chain안에서 규칙을 삽입하기 위한 위치를 지정할 때에 유용합니다.
-t <table-name>
— Specifies a table name. If omitted, defaults to the filter table.
-x
옵션을 포함하여 나타나는 바이트 표시에 있어서 다른점에 주의하시기 바랍니다.
~]#iptables -L OUTPUT -v -n -x
Chain OUTPUT (policy ACCEPT 64005 packets, 6445791 bytes) pkts bytes target prot opt in out source destination 1593 133812 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0 ~]#iptables -L OUTPUT -v -n
Chain OUTPUT (policy ACCEPT 64783 packets, 6492K bytes) pkts bytes target prot opt in out source destination 1819 153K ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0 ~]#
iptables
명령과 함께 생성된 규칙은 메모리에 저장되어 있습니다. iptables
규칙 모음을 저장하기 전에 시스템을 재시작하실 경우, 모든 규칙이 삭제됩니다. 시스템 재부팅을 통한 넷필터 규칙은 저장되어야 합니다. 넷필터 규칙을 저장하기 위해 root로 다음의 명령을 입력하시기 바랍니다:
service iptables save
iptables
init 스크립트를 실행하고, /sbin/iptables-save
프로그램을 실행하며 현재 iptables
설정을 /etc/sysconfig/iptables
에 기록합니다. 기존의 /etc/sysconfig/iptables
파일은 /etc/sysconfig/iptables.save
로 저장됩니다.
iptables
init 스크립트는 /sbin/iptables-restore
명령을 사용하여 /etc/sysconfig/iptables
에 저장된 규칙을 재적용합니다.
iptables
rule before committing it to the /etc/sysconfig/iptables
file, it is possible to copy iptables
rules into this file from another system's version of this file. This provides a quick way to distribute sets of iptables
rules to multiple machines.
iptables-save > <filename>
<filename>
is a user-defined name for your ruleset.
/etc/sysconfig/iptables
파일을 다른 컴퓨터로 배포할 경우, 새로운 규칙을 실행하기 위해 /sbin/service iptables restart
을 입력하시기 바랍니다.
iptables
기능을 구성하는 테이블과 chain을 조작하기 위해 사용되는 iptables
명령 (/sbin/iptables
)와 iptables
서비스 자체를 활성화 및 비활성화하는데 사용되는 iptables
서비스 (/sbin/iptables service
) 사이의 다른점에 주의하시기 바랍니다.
iptables
제어하는 두가지 기본적인 방법이 있습니다:
system-config-securitylevel
) — A graphical interface for creating, activating, and saving basic firewall rules. Refer to 46.8.2절. “Basic Firewall Configuration” for more information.
/sbin/service iptables <option>
— Used to manipulate various functions of iptables
using its initscript. The following options are available:
start
— 방화벽이 설정되어 있을 경우 (즉, /etc/sysconfig/iptables
가 존재할 경우), 실행되는 모든 iptables
는 완전히 정지되며 /sbin/iptables-restore
명령을 사용하기 시작합니다. 이러한 옵션은 ipchains
커널 모듈을 읽어오지 않았을 때에만 작동합니다. 이러한 모듈을 읽어왔는지를 확인하시려면, root로 다음의 명령을 입력하시기 바랍니다:
lsmod | grep ipchains
/sbin/rmmod
명령을 사용하시기 바랍니다.
stop
— 방화벽이 실행되고 있을 경우, 메모리에 있는 방화벽 규칙은 삭제되며, 모든 iptables 모듈 및 도움 프로그램이 제거됩니다.
/etc/sysconfig/iptables-config
설정 파일에서 IPTABLES_SAVE_ON_STOP
지시문이 기본값에서 yes
로 변경된 경우, 현재 규칙은 /etc/sysconfig/iptables
에 저장되며 기존의 규칙은 /etc/sysconfig/iptables.save
파일로 이동합니다.
iptables-config
file.
restart
— 방화벽이 실행되고 있는 경우, 메모리에 있는 방화벽 규칙은 삭제되며, 방화벽이 /etc/sysconfig/iptables
에 설정되어 있을 경우 이를 다시 시작하게 됩니다. 이러한 옵션은 ipchains
커널 모듈을 읽어오지 않았을 경우에만 작동합니다.
/etc/sysconfig/iptables-config
설정 파일에서 IPTABLES_SAVE_ON_RESTART
지시문이 기본값에서 yes
로 변경된 경우, 현재 규칙은 /etc/sysconfig/iptables
에 저장되며 기존의 규칙은 /etc/sysconfig/iptables.save
파일로 이동합니다.
iptables-config
file.
status
— 방화벽의 상태를 보여주며 모든 활성 규칙 목록을 만듭니다.
/etc/sysconfig/iptables-config
file and change the value of IPTABLES_STATUS_NUMERIC
to no
. Refer to 46.9.5.1절. “IPTables 제어 스크립트 설정 파일” for more information about the iptables-config
file.
panic
— 모든 방화벽 규칙을 삭제합니다. 모든 설정 테이블에 대한 정책은 DROP
에 설정됩니다.
save
— Saves firewall rules to /etc/sysconfig/iptables
using iptables-save
. Refer to 46.9.4절. “IPTables 규칙 저장하기” for more information.
ip6tables
for iptables
in the /sbin/service
commands listed in this section. For more information about IPv6 and netfilter, refer to 46.9.6절. “IPTables 및 IPv6”.
iptables
initscripts의 동작은 /etc/sysconfig/iptables-config
설정 파일에 의해 제어됩니다. 다음은 이러한 파일에 들어 있는 지시문 목록입니다:
IPTABLES_MODULES
— 방화벽이 활성화 상태일 때, 불러오려는 추가 iptables
모듈의 목록을 공백으로 구분하여 지정합니다. 이에는 연결 추적 및 NAT 도움말이 포함될 수 있습니다.
IPTABLES_MODULES_UNLOAD
— 재시작 및 정지 상태에서 모듈을 읽어오지 않습니다. 이러한 지시문은 다음과 같은 값을 허용합니다:
yes
— 기본 값. 방화벽 재시작 또는 정지에 대한 올바른 상태를 실행하기 위해 이러한 옵션이 설정되어야 합니다.
no
— 넷필터 모듈을 제거하는 데 문제가 있을 경우에만 이러한 옵션을 설정해야 합니다.
IPTABLES_SAVE_ON_STOP
— 방화벽이 중지되었을 때 현재 방화벽 규칙을 /etc/sysconfig/iptables
에 저장합니다. 이러한 지시문은 다음과 같은 규칙을 허용합니다:
yes
— 방화벽이 중지되었을 때 기존의 규칙을 /etc/sysconfig/iptables
에 저장하고, 이전 버전을 /etc/sysconfig/iptables.save
파일로 이동시킵니다.
no
— 기본값. 방화벽이 중지되었을 때 기존 규칙을 저장하지 않습니다.
IPTABLES_SAVE_ON_RESTART
— 방화벽을 재시작할 때 현재 방화벽 규칙을 저장합니다. 이러한 지시문은 다음과 같은 값을 허용합니다:
yes
— 방화벽을 재시작할 때, 기존의 규칙을 /etc/sysconfig/iptables
에 저장하고, 이전 버전을 /etc/sysconfig/iptables.save
파일로 이동시킵니다.
no
— 기본값. 방화벽을 재시작할 때 기존 규칙을 저장하지 않습니다.
IPTABLES_SAVE_COUNTER
— 모든 chain 및 규칙에 있는 모든 패킷과 바이트를 저장하거나 복구합니다. 이러한 지시문은 다음과 같은 값을 허용합니다:
yes
— 카운터 값을 저장합니다.
no
— 기본값. 카운터 값을 저장하지 않습니다.
IPTABLES_STATUS_NUMERIC
— 도메인 또는 호스트명을 대신하여 숫자로된 포맷에서 IP 주소를 출력합니다. 이러한 지시문은 다음과 같은 값을 허용합니다:
yes
— 기본값. 출력 상태안에서 IP 주소만을 복귀하게 합니다.
no
— 출력 상태 안에서 도메인 또는 호스트명을 복귀하게 합니다.
iptables-ipv6
패키지가 설치되었을 경우, Red Hat Enterprise Linux에 있는 넷필터는 차세대 IPv6 인터넷 프로토콜을 거를수 있습니다. IPv6 넷필터를 조작하기 위해 사용되는 명령은 ip6tables
입니다.
iptables
에서 사용된 것과 동일하지만, nat
테이블은 아직 지원되지 않습니다. 즉, 이는 매스커레이딩(masquerading) 및 포트 포워딩과 같은 IPv6 네트워크 주소 번역 작업을 아직 실행할 수 없음을 의미합니다.
ip6tables
에 대한 규칙은 /etc/sysconfig/ip6tables
파일에 저장되어 있습니다. ip6tables
initscripts에 의해 저장된 기존 규칙은 /etc/sysconfig/ip6tables.save
파일에 저장되어 있습니다.
ip6tables
init 스크립트에 대한 설정 옵션은 /etc/sysconfig/ip6tables-config
에 저장되어 있으며, 각각의 지시문에 해당하는 이름은 iptables
부분에 따라 다릅니다.
iptables-config
지시문 IPTABLES_MODULES
: ip6tables-config
파일과 같은 것은 IP6TABLES_MODULES
입니다.
iptables
과 함께 패킷 필터링에 관한 추가 정보는 다음 소스에서 참조하시기 바랍니다.
iptables
에 관한 정보는 물론, 특정 문제를 다루고 있는 FAQ 및 Linux IP 방화벽 관리자인 Rusty Russell에 의해 쓰여진 도움말 등이 들어있습니다. 사이트에 있는 HOWTO 문서에서는 기본적인 네트워킹 개념, 커널 패킷 필터링, NAT 설정과 같은 주제를 다루고 있습니다.
iptables
명령을 구축하는 방법에 대한 소개.
avc: denied
message detailed in /var/log/messages
if permission is denied. The security context of subjects and objects is applied from the installed policy, which also provides the information to populate the security server's matrix.
/selinux/
pseudo-file system contains commands that are most commonly used by the kernel subsystem. This type of file system is similar to the /proc/
pseudo-file system.
/selinux/
directory:
-rw-rw-rw- 1 root root 0 Sep 22 13:14 access dr-xr-xr-x 1 root root 0 Sep 22 13:14 booleans --w------- 1 root root 0 Sep 22 13:14 commit_pending_bools -rw-rw-rw- 1 root root 0 Sep 22 13:14 context -rw-rw-rw- 1 root root 0 Sep 22 13:14 create --w------- 1 root root 0 Sep 22 13:14 disable -rw-r--r-- 1 root root 0 Sep 22 13:14 enforce -rw------- 1 root root 0 Sep 22 13:14 load -r--r--r-- 1 root root 0 Sep 22 13:14 mls -r--r--r-- 1 root root 0 Sep 22 13:14 policyvers -rw-rw-rw- 1 root root 0 Sep 22 13:14 relabel -rw-rw-rw- 1 root root 0 Sep 22 13:14 user
cat
command on the enforce
file reveals either a 1
for enforcing mode or 0
for permissive mode.
/etc/
directory.
/etc/sysconfig/selinux
Configuration Filesystem-config-selinux
), or manually editing the configuration file (/etc/sysconfig/selinux
).
/etc/sysconfig/selinux
file is the primary configuration file for enabling or disabling SELinux, as well as for setting which policy to enforce on the system and how to enforce it.
/etc/sysconfig/selinux
contains a symbolic link to the actual configuration file, /etc/selinux/config
.
SELINUX=enforcing|permissive|disabled
— Defines the top-level state of SELinux on a system.
enforcing
— The SELinux security policy is enforced.
permissive
— The SELinux system prints warnings but does not enforce policy.
avc: denied
messages for every directory level read. In enforcing mode, SELinux would have stopped the initial traversal and kept further denial messages from occurring.
disabled
— SELinux is fully disabled. SELinux hooks are disengaged from the kernel and the pseudo-file system is unregistered.
/.autorelabel
and reboot the machine. This causes the relabel to occur very early in the boot process, before any processes are running on the system. Using this procedure means that processes can not accidentally create files in the wrong context or start up in the wrong context.
fixfiles relabel
command prior to enabling SELinux to relabel the file system. This method is not recommended, however, because after it is complete, it is still possible to have processes potentially running on the system in the wrong context. These processes could create files that would also be in the wrong context.
SELINUXTYPE=targeted|strict
— Specifies which policy SELinux should enforce.
targeted
— Only targeted network daemons are protected.
dhcpd, httpd (apache.te), named, nscd, ntpd, portmap, snmpd, squid
, and syslogd
. The rest of the system runs in the unconfined_t domain. This domain allows subjects and objects with that security context to operate using standard Linux security.
/etc/selinux/targeted/src/policy/domains/program
. These files are subject to change as newer versions of Red Hat Enterprise Linux are released.
system-config-selinux
).
1
disables SELinux protection for the daemon. For example, you can set dhcpd_disable_trans
to 1
to prevent init
, which executes apps labeled dhcpd_exec_t
, from transitioning to the dhcpd_t
domain.
getsebool -a
command to list all SELinux booleans. The following is an example of using the setsebool
command to set an SELinux boolean. The -P
option makes the change permanent. Without this option, the boolean would be reset to 1
at reboot.
setsebool -P dhcpd_disable_trans=0
strict
— Full SELinux protection, for all daemons. Security contexts are defined for all subjects and objects, and every action is processed by the policy enforcement server.
SETLOCALDEFS=0|1
— Controls how local definitions (users and booleans) are set. Set this value to 1 to have these definitions controlled by load_policy
from files in /etc/selinux/<policyname>
. or set it to 0 to have them controlled by semanage
.
/etc/selinux/
Directory/etc/selinux/
directory is the primary location for all policy files as well as the main configuration file.
/etc/selinux/
directory:
-rw-r--r-- 1 root root 448 Sep 22 17:34 config drwxr-xr-x 5 root root 4096 Sep 22 17:27 strict drwxr-xr-x 5 root root 4096 Sep 22 17:28 targeted
strict/
and targeted/
, are the specific directories where the policy files of the same name (that is, strict
and targeted
) are contained.
/usr/sbin/setenforce
— Modifies in real-time the mode in which SELinux runs.
setenforce 1
— SELinux runs in enforcing mode.
setenforce 0
— SELinux runs in permissive mode.
setenforce
parameter in /etc/sysconfig/selinux
or pass the parameter selinux=0
to the kernel, either in /etc/grub.conf
or at boot time.
/usr/sbin/sestatus -v
— Displays the detailed status of a system running SELinux. The following example shows an excerpt of sestatus -v
output:
SELinux status: enabled SELinuxfs mount: /selinux Current mode: enforcing Mode from config file: enforcing Policy version: 21 Policy from config file: targeted Process contexts: Current context: user_u:system_r:unconfined_t:s0 Init context: system_u:system_r:init_t:s0 /sbin/mingetty system_u:system_r:getty_t:s0
/usr/bin/newrole
— Runs a new shell in a new context, or role. Policy must allow the transition to the new role.
policycoreutils-newrole
package installed, which is required for the strict and MLS policies.
/sbin/restorecon
— Sets the security context of one or more files by marking the extended attributes with the appropriate file or security context.
/sbin/fixfiles
— Checks or corrects the security context database on the file system.
setools
or policycoreutils
package contents for more information on all available binary utilities. To view the contents of a package, use the following command:
rpm -ql <package-name>
/usr/share/doc/setools-<version-number
>/
All documentation for utilities contained in the setools
package. This includes all helper scripts, sample configuration files, and documentation.
<x>
series of Linux kernels. This module stored PSIDs in a normal file, and SELinux was able to support more file systems. This solution was not optimal for performance, and was inconsistent across platforms. Finally, the SELinux code was integrated upstream to the 2.6.x
kernel, which has full support for LSM and has extended attributes (xattrs) in the ext3 file system. SELinux was moved to using xattrs to store security context information. The xattr namespace provides useful separation for multiple security modules existing on the same system.
"security."
namespace is used for security modules, and the security.selinux
name is used to persistently store SELinux security labels on files. The contents of this attribute will vary depending on the file or directory you inspect and the policy the machine is enforcing.
getxattr(2)
always returns the kernel's canonicalized version of the label.
ls -Z
command to view the category label of a file:
~]# ls -Z gravityControl.txt
-rw-r--r-- user user user_u:object_r:tmp_t:Moonbase_Plans gravityControl.txt
gefattr(1)
command to view the internal category value (c10):
~]# getfattr -n security.selinux gravityControl.txt
# file: gravityControl.txt
security.selinux="user_u:object_r:tmp_t:s0:c10\000"
semanage user -l
command to list SELinux users:
~]# semanage user -l
Labeling MLS/ MLS/
SELinux User Prefix MCS Level MCS Range SELinux Roles
root user s0 s0-s0:c0.c1023 system_r sysadm_r user_r
system_u user s0 s0-s0:c0.c1023 system_r
user_u user s0 s0-s0:c0.c1023 system_r sysadm_r user_r
user_u
). This is solved by introducing the concept of an SELinux login. This is used during the login process to assign MCS categories to Linux users when their shell is launched.
semanage login -a
command to assign Linux users to SELinux user identities:
~]#semanage login -a james
~]#semanage login -a daniel
~]#semanage login -a olga
~]# semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ user_u s0
james user_u s0
daniel user_u s0
root root s0-s0:c0.c1023
olga user_u s0
setrans.conf
file. The system administrator edits this file to manage and maintain the required categories.
chcat -L
command to list the current categories:
~]# chcat -L
s0
s0-s0:c0.c1023 SystemLow-SystemHigh
s0:c0.c1023 SystemHigh
/etc/selinux/<selinuxtype
>/setrans.conf
file. For the example introduced above, add the Marketing, Finance, Payroll, and Personnel categories as follows (this example uses the targeted policy, and irrelevant sections of the file have been omitted):
~]# vi /etc/selinux/targeted/setrans.conf
s0:c0=Marketing
s0:c1=Finance
s0:c2=Payroll
s0:c3=Personnel
chcat -L
command to check the newly-added categories:
~]# chcat -L
s0:c0 Marketing
s0:c1 Finance
s0:c2 Payroll
s0:c3 Personnel
s0
s0-s0:c0.c1023 SystemLow-SystemHigh
s0:c0.c1023 SystemHigh
setrans.conf
file, you need to restart the MCS translation service before those changes take effect. Use the following command to restart the service:
~]# service mcstrans restart
chcat
command to assign MCS categories to SELinux logins:
~]#chcat -l -- +Marketing james
~]#chcat -l -- +Finance,+Payroll daniel
~]#chcat -l -- +Personnel olga
chcat
command with additional command-line arguments to list the categories that are assigned to users:
~]# chcat -L -l daniel james olga
daniel: Finance,Payroll
james: Marketing
olga: Personnel
# Create a user account for the company director (Karl) ~]#useradd karl
~]#passwd karl
Changing password for user karl. New UNIX password: Retype new UNIX password: passwd: all authentication tokens updated successfully. # Assign the user account to an SELinux login ~]#semanage login -a karl
# Assign all the MCS categories to the new login ~]#chcat -l -- +Marketing,+Finance,+Payroll,+Personnel karl
chcat
command to verify the addition of the new user:
~]# chcat -L -l daniel james olga karl
daniel: Finance,Payroll
james: Marketing
olga: Personnel
karl: Marketing,Finance,Payroll,Personnel
[daniel@dhcp-133 ~]$ echo "Financial Records 2006" > financeRecords.txt
ls -Z
command to check the initial security context of the file:
[daniel@dhcp-133 ~]$ ls -Z financeRecords.txt
-rw-r--r-- daniel daniel user_u:object_r:user_home_t financeRecords.txt
user_home_t
) and has no categories assigned to it. We can add the required category using the chcat
command. Now when you check the security context of the file, you can see the category has been applied.
[daniel@dhcp-133 ~]$chcat -- +Finance financeRecords.txt
[daniel@dhcp-133 ~]$ls -Z financeRecords.txt
-rw-r--r-- daniel daniel root:object_r:user_home_t:Finance financeRecords.txt
[daniel@dhcp-133 ~]$chcat -- +Payroll financeRecords.txt
[daniel@dhcp-133 ~]$ls -Z financeRecords.txt
-rw-r--r-- daniel daniel root:object_r:user_home_t:Finance,Payroll financeRecords.txt
[olga@dhcp-133 ~]$ cat financeRecords.txt
cat: financeRecords.txt: Permission Denied
semanage
and chcat
for more information on the available options for these commands.
Sensitivity
: — A hierarchical attribute such as "Secret" or "Top Secret".
Categories
: — A set of non-hierarchical attributes such as "US Only" or "UFO".
user_home_t
.
unconfined_t
domain have an executable file with a type such as sbin_t
. From an SELinux perspective, this means they are all equivalent in terms of what they can and cannot do on the system.
/usr/bin/postgres
has the type postgresql_exec_t. All of the targeted daemons have their own *_exec_t
type for their executable applications. In fact, the entire set of PostgreSQL executables such as createlang
, pg_dump
, and pg_restore
have the same type, postgresql_exec_t
, and they transition to the same domain, postgresql_t
, upon execution.
$AUDIT_LOG
file. In Red Hat Enterprise Linux, this is set to /var/log/messages
. The policy is compiled into binary format for loading into the kernel security server, and each time the security server makes a decision, it is cached in the AVC to optimize performance.
init
, as explained in 47.7.3절. “The Role of Policy in the Boot Process”. Ultimately, every system operation is determined by the policy and the type-labeling of the files.
m4
macros to capture common sets of low-level rules. A number of m4
macros are defined in the existing policy, which facilitate the writing of new policy. These rules are preprocessed into many additional rules as part of building the policy.conf
file, which is compiled into the binary policy.
newrole
, or by requiring a new process execution in the new domain. This movement between domains is referred to as a transition.
selinux-policy-<policyname>
package and supplies the binary policy file.
selinux-policy-devel
package is installed.
/etc/selinux/targeted/
— this is the root directory for the targeted policy, and contains the binary tree.
/etc/selinux/targeted/policy/
— this is the location of the binary policy file policy.<xx>
. In this guide, the variable SELINUX_POLICY
is used for this directory.
/etc/selinux/targeted/contexts/
— this is the location of the security context information and configuration files, which are used during runtime by various applications.
/etc/selinux/targeted/contexts/files/
— contains the default contexts for the entire file system. This is referenced by restorecon
when performing relabeling operations.
/etc/selinux/targeted/contexts/users/
— in the targeted policy, only the root
file is in this directory. These files are used for determining context when a user logs in. For example, for the root user, the context is user_u:system_r:unconfined_t.
/etc/selinux/targeted/modules/active/booleans*
— this is where the runtime Booleans are configured.
getsebool
, setsebool
and semanage
tools to manipulate runtime Booleans.
selinux-policy-devel
package includes all of the interface files used to build policy. It is recommended that people who build policy use these files to build the policy modules.
/usr/share/selinux/devel/include
and has make
files installed in /usr/share/selinux/devel/Makefile
.
libselinux
provides a number of functions that return the paths to the different configuration files and directories. This negates the need for applications to hard-code the paths, especially since the active policy location is dependent on the SELINUXTYPE setting in /etc/selinux/config
.
/etc/selinux/strict
.
man 3 selinux_binary_policy_path
libselinux-devel
RPM installed.
libselinux
and related functions is outside the scope of this document.
init
performs some essential operations early in the boot process to maintain synchronization between labeling and policy enforcement.
/sbin/init
mounts /proc/
, and then searches for the selinuxfs
file system type. If it is present, that means SELinux is enabled in the kernel.
init
does not find SELinux in the kernel, or if it is disabled via the selinux=0
boot parameter, or if /etc/selinux/config
specifies that SELINUX=disabled
, the boot process proceeds with a non-SELinux system.
init
sets the enforcing status if it is different from the setting in /etc/selinux/config
. This happens when a parameter is passed during the boot process, such as enforcing=0
or enforcing=1
. The kernel does not enforce any policy until the initial policy is loaded.
/selinux/
is mounted.
init
checks /selinux/policyvers
for the supported policy version. The version number in /selinux/policyvers
is the latest policy version your kernel supports. init
inspects /etc/selinux/config
to determine which policy is active, such as the targeted policy, and loads the associated file at $SELINUX_POLICY/policy.<version>
.
init
attempts to load the policy file if it is a previous version. This provides backward compatibility with older policy versions.
/etc/selinux/targeted/booleans
are different from those compiled in the policy, init
modifies the policy in memory based on the local settings prior to loading the policy into the kernel.
init
then re-executes itself so that it can transition to a different domain, if the policy defines it. For the targeted policy, there is no transition defined and init
remains in the unconfined_t
domain.
init
continues with its normal boot process.
init
re-executes itself is to accommodate stricter SELinux policy controls. The objective of re-execution is to transition to a new domain with its own granular rules. The only way that a process can enter a domain is during execution, which means that such processes are the only entry points into the domains.
init
, such as init_t
, a method is required to change from the initial SID, such as kernel, to the correct runtime domain for init
. Because this transition may need to occur, init
is coded to re-execute itself after loading the policy.
init
transition occurs if the domain_auto_trans(kernel_t, init_exec_t, <target_domain_t>
)
rule is present in the policy. This rule states that an automatic transition occurs on anything executing in the kernel_t
domain that executes a file of type init_exec_t. When this execution occurs, the new process is assigned the domain <target_domain_t>
, using an actual target domain such as init_t
.
filesystem
for file systems, file
for files, and dir
for directories. Each class has its own associated set of permissions.
filesystem
class can mount, unmount, get attributes, set quotas, relabel, and so forth. The file
class has common file permissions such as read, write, get and set attributes, lock, relabel, link, rename, append, etc.
tcp_socket
for TCP sockets, netif
for network interfaces, and node
for network nodes.
netif
class, for example, can send and receive on TCP, UDP and raw sockets (tcp_recv
, tcp_send
, udp_send
, udp_recv
, rawip_recv
, and rawip_send
.)
unconfined_t
domain except for the specific targeted daemons. Objects that are in the unconfined_t
domain have no restrictions and fall back to using standard Linux security, that is, DAC. The daemons that are part of the targeted policy run in their own domains and are restricted in every operation they perform on the system. This way daemons that are exploited or compromised in any way are contained and can only cause limited damage.
http
and ntp
daemons are both protected in the default targeted policy, and run in the httpd_t
and ntpd_t
domains, respectively. The ssh
daemon, however, is not protected in this policy, and consequently runs in the unconfined_t
domain.
user_u:system_r:httpd_t 25129 ? 00:00:00 httpd user_u:system_r:ntpd_t 25176 ? 00:00:00 ntpd system_u:system_r:unconfined_t 25245 ? 00:00:00 sshd
dhcpd
; httpd
; mysqld
; named
; nscd
; ntpd
; portmap
; postgres
; snmpd
; squid
; syslogd
; and winbind
.
unconfined_t
type exists in every role, which significantly reduces the usefulness of roles in the targeted policy. More extensive use of roles requires a change to the strict policy paradigm, where every process runs in an individually considered domain.
system_r
and object_r
. The initial role is system_r
, and everything else inherits that role. The remaining roles are defined for compatibility purposes between the targeted policy and the strict policy.[20]
object_r
, is an implied role and is not found in policy source. Because roles are created and populated by types using one or more declarations in the policy, there is no single file that declares all roles. (Remember that the policy itself is generated from a number of separate files.)
system_r
system_r (28 types) dhcpd_t httpd_helper_t httpd_php_t httpd_suexec_t httpd_sys_script_t httpd_t httpd_unconfined_script_t initrc_t ldconfig_t mailman_cgi_t mailman_mail_t mailman_queue_t mysqld_t named_t ndc_t nscd_t ntpd_t pegasus_t portmap_t postgresql_t snmpd_t squid_t syslogd_t system_mail_t unconfined_t winbind_helper_t winbind_t ypbind_t
user_r
unconfined_t
domain.
object_r
object_r
, and the role is only used as a placeholder in the label.
sysadm_r
staff_r
. If this is true, use the newrole -r sysadm_r
command to change to the SELinux system administrator role to perform system administration tasks. In the targeted policy, the following retain sysadm_r
for compatibility:
sysadm_r (6 types) httpd_helper_t httpd_sys_script_t initrc_t ldconfig_t ndc_t unconfined_t
user_u
identity was chosen because libselinux
falls back to user_u
as the default SELinux user identity. This occurs when there is no matching SELinux user for the Linux user who is logging in. Using user_u
as the single user in the targeted policy makes it easier to change to the strict policy. The remaining users exist for compatibility with the strict policy.[21]
root
. You may notice root
as the user identity in a process's context. This occurs when the SELinux user root
starts daemons from the command line, or restarts a daemon originally started by init
.
system_r
already had existing authorization for the daemon domains, simplifying the process. This was done because no mechanism currently exists to alias roles.
unconfined_t
along with the rest of the system except the targeted daemons.
avc: denied
message.
mv
and cp
may have unexpected results.
cp
follows the default behavior of creating a new file based on the domain of the creating process and the type of the target directory. Unless there is a specific rule to set the label, the file inherits the type from the target directory.
-Z user:role:type
option to specify the required label for the new file.
-p
(or --preserve=mode,ownership,timestamps
) option preserves the specified attributes and, if possible, additional attributes such as links.
touch bar foo ls -Z bar foo -rw-rw-r-- auser auser user_u:object_r:user_home_t bar -rw-rw-r-- auser auser user_u:object_r:user_home_t foo
cp
command without any additional command-line arguments, a copy of the file is created in the new location using the default type of the creating process and the target directory. In this case, because there is no specific rule that applies to cp
and /tmp
, the new file has the type of the parent directory:
cp bar /tmp ls -Z /tmp/bar -rw-rw-r-- auser auser user_u:object_r:tmp_t /tmp/bar
tmp_t
is the default type for temporary files.
-Z
option to specify the label for the new file:
cp -Z user_u:object_r:user_home_t foo /tmp ls -Z /tmp/foo -rw-rw-r-- auser auser user_u:object_r:user_home_t /tmp/foo
mv
retains the original type associated with the file. Care should be taken using this command as it can cause problems. For example, if you move files with the type user_home_t
into ~/public_html
, then the httpd
daemon is not able to serve those files until you relabel them. Refer to 48.1.3절. “Relabeling a File or Directory” for more information about file labeling.
Command | Behavior |
---|---|
mv
|
The file retains its original label. This may cause problems, confusion, or minor insecurity. For example, the tmpwatch program running in the sbin_t domain might not be allowed to delete an aged file in the /tmp directory because of the file's type.
|
cp
|
Makes a copy of the file using the default behavior based on the domain of the creating process (cp ) and the type of the target directory.
|
cp -p
| Makes a copy of the file, preserving the specified attributes and security contexts, if possible. The default attributes are mode, ownership, and timestamps. Additional attributes are links and all. |
cp -Z
|
Makes a copy of the file with the specified labels. The -Z option is synonymous with --context .
|
-Z
option is equivalent to --context
, and can be used with the ps
, id
, ls
, and cp
commands. The behavior of the cp
command with respect to SELinux is explained in 표 48.1. “Behavior of mv and cp Commands”.
ps
command. Most of the processes are running in the unconfined_t
domain, with a few exceptions.
[user@localhost ~]$ ps auxZ LABEL USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND system_u:system_r:init_t root 1 0.0 0.1 2032 620 ? Ss 15:09 0:00 init [5] system_u:system_r:kernel_t root 2 0.0 0.0 0 0 ? S 15:09 0:00 [migration/0] system_u:system_r:kernel_t root 3 0.0 0.0 0 0 ? SN 15:09 0:00 [ksoftirqd/0] user_u:system_r:unconfined_t user 3122 0.0 0.6 6908 3232 ? S 16:47 0:01 /usr/libexec/gconfd-2 5 user_u:system_r:unconfined_t user 3125 0.0 0.1 2540 588 ? S 16:47 0:00 /usr/bin/gnome-keyring-daemon user_u:system_r:unconfined_t user 3127 0.0 1.4 33612 6988 ? Sl 16:47 0:00 /usr/libexec/gnome-settings-daemon user_u:system_r:unconfined_t user 3144 0.1 1.4 16528 7360 ? Ss 16:47 0:01 metacity --sm-client-id=default1 user_u:system_r:unconfined_t user 3148 0.2 2.9 79544 14808 ? Ss 16:47 0:03 gnome-panel --sm-client-id default2
-Z
option with the id
command to determine a user's security context. Note that with this command you cannot combine -Z
with other options.
[root@localhost ~]# id -Z user_u:system_r:unconfined_t
-Z
option with the id
command to inspect the security context of a different user. That is, you can only display the security context of the currently logged-in user:
[user@localhost ~]$ id uid=501(user) gid=501(user) groups=501(user) context=user_u:system_r:unconfined_t [user@localhost ~]$ id root uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel) [user@localhost ~]$ id -Z root id: cannot display context when selinux not enabled or when displaying the id of a different user
-Z
option with the ls
command to group common long-format information. You can display mode, user, group, security context, and filename information.
cd /etc ls -Z h* -d drwxr-xr-x root root system_u:object_r:etc_t hal -rw-r--r-- root root system_u:object_r:etc_t host.conf -rw-r--r-- root root user_u:object_r:etc_t hosts -rw-r--r-- root root system_u:object_r:etc_t hosts.allow -rw-r--r-- root root system_u:object_r:etc_t hosts.canna -rw-r--r-- root root system_u:object_r:etc_t hosts.deny drwxr-xr-x root root system_u:object_r:hotplug_etc_t hotplug drwxr-xr-x root root system_u:object_r:etc_t hotplug.d drwxr-xr-x root root system_u:object_r:httpd_sys_content_t htdig drwxr-xr-x root root system_u:object_r:httpd_config_t httpd
~/public_html
directories, or when writing scripts that work in directories outside of /home
.
/usr/sbin/mysqld
has the wrong security label, and you address this by using a relabeling operation such as restorecon
, you must restart mysqld
after the relabeling operation. Setting the executable file to have the correct type (mysqld_exec_t
) ensures that it transitions to the proper domain when started.
chcon
command to change a file to the correct type. You need to know the correct type that you want to apply to use this command. The directories and files in the following example are labeled with the default type defined for file system objects created in /home
:
cd ~ ls -Zd public_html/ drwxrwxr-x auser auser user_u:object_r:user_home_t public_html/ ls -Z web_files/ -rw-rw-r-- auser auser user_u:object_r:user_home_t 1.html -rw-rw-r-- auser auser user_u:object_r:user_home_t 2.html -rw-rw-r-- auser auser user_u:object_r:user_home_t 3.html -rw-rw-r-- auser auser user_u:object_r:user_home_t 4.html -rw-rw-r-- auser auser user_u:object_r:user_home_t 5.html -rw-rw-r-- auser auser user_u:object_r:user_home_t index.html
public_html
directory, they retain the original type:
mv web_files/* public_html/ ls -Z public_html/ -rw-rw-r-- auser auser user_u:object_r:user_home_t 1.html -rw-rw-r-- auser auser user_u:object_r:user_home_t 2.html -rw-rw-r-- auser auser user_u:object_r:user_home_t 3.html -rw-rw-r-- auser auser user_u:object_r:user_home_t 4.html -rw-rw-r-- auser auser user_u:object_r:user_home_t 5.html -rw-rw-r-- auser auser user_u:object_r:user_home_t index.html
httpd
has permissions to read, presuming the Apache HTTP Server is configured for UserDir and the Boolean value httpd_enable_homedirs
is enabled.
chcon -R -t httpd_user_content_t public_html/ ls -Z public_html -rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t 1.html -rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t 2.html -rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t 3.html -rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t 4.html -rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t 5.html -rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t index.html ls -Z public_html/ -d drwxrwxr-x auser auser user_u:object_r:httpd_user_content_t public_html/
chcon system_u:object_r:shlib_t foo.so
. Otherwise, you will receive an error about applying a partial context to an unlabeled file.
restorecon
command to restore files to the default values according to the policy. There are two other methods for performing this operation that work on the entire file system: fixfiles
or a policy relabeling operation. Each of these methods requires superuser privileges. Cautions against both of these methods appear in 48.2.2절. “Relabeling a File System”.
ls -Z /tmp/ -rw-rw-r-- auser auser user_u:object_r:tmp_t /tmp/file1 -rw-rw-r-- auser auser user_u:object_r:tmp_t /tmp/file2 -rw-rw-r-- auser auser user_u:object_r:tmp_t /tmp/file3 mv /tmp/{1,2,3} archives/ mv public_html/* archives/ ls -Z archives/ -rw-rw-r-- auser auser user_u:object_r:tmp_t file1 -rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t file1.html -rw-rw-r-- auser auser user_u:object_r:tmp_t file2 -rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t file2.html -rw-rw-r-- auser auser user_u:object_r:tmp_t file3 -rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t file3.html -rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t file4.html -rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t file5.html -rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t index.html
archives/
directory already has the default type because it was created in the user's home directory:
ls -Zd archives/ drwxrwxr-x auser auser user_u:object_r:user_home_t archives/
restorecon
command to relabel the files uses the default file contexts set by the policy, so these files are labeled with the default label for their current directory.
/sbin/restorecon -R archives/ ls -Z archives/ -rw-rw-r-- auser auser system_u:object_r:user_home_t file1 -rw-rw-r-- auser auser system_u:object_r:user_home_t file1.html -rw-rw-r-- auser auser system_u:object_r:user_home_t file2 -rw-rw-r-- auser auser system_u:object_r:user_home_t file2.html -rw-rw-r-- auser auser system_u:object_r:user_home_t file3 -rw-rw-r-- auser auser system_u:object_r:user_home_t file3.html -rw-rw-r-- auser auser system_u:object_r:user_home_t file4.html -rw-rw-r-- auser auser system_u:object_r:user_home_t file5.html -rw-rw-r-- auser auser system_u:object_r:user_home_t index.html
tar
or star
utilities to create archives that retain SELinux security contexts. The following example uses star
to demonstrate how to create such an archive. You need to use the appropriate -xattr
and -H=exustar
options to ensure that the extra attributes are captured and that the header for the *.star
file is of a type that fully supports xattrs. Refer to the man page for more information about these and other options.
ls -Z public_html/ web_files/ public_html/: -rw-rw-r-- auser auser ...httpd_user_content_t 1.html -rw-rw-r-- auser auser ...httpd_user_content_t 2.html -rw-rw-r-- auser auser ...httpd_user_content_t 3.html -rw-rw-r-- auser auser ...httpd_user_content_t 4.html -rw-rw-r-- auser auser ...httpd_user_content_t 5.html -rw-rw-r-- auser auser ...httpd_user_content_t index.html web_files/: -rw-rw-r-- auser auser user_u:object_r:user_home_t 1.html -rw-rw-r-- auser auser user_u:object_r:user_home_t 2.html -rw-rw-r-- auser auser user_u:object_r:user_home_t 3.html -rw-rw-r-- auser auser user_u:object_r:user_home_t 4.html -rw-rw-r-- auser auser user_u:object_r:user_home_t 5.html -rw-rw-r-- auser auser user_u:object_r:user_home_t index.html
star -xattr -H=exustar -c -f all_web.star public_html/ web_files/ star: 11 blocks + 0 bytes (total of 112640 bytes = 110.00k).
ls
command with the -Z
option to validate the security context:
ls -Z all_web.star -rw-rw-r-- auser auser user_u:object_r:user_home_t \ all_web.star
/tmp
. If there is no specific policy to make a derivative temporary type, the default behavior is to acquire the tmp_t
type.
cp all_web.star /tmp/ cd /tmp/ ls -Z all_web.star -rw-rw-r-- auser auser user_u:object_r:tmp_t all_web.star
star
and it restores the extended attributes:
star -xattr -x -f all_web.star star: 11 blocks + 0 bytes (total of 112640 bytes = 110.00k). ls -Z /tmp/public_html/ /tmp/web_files/ /tmp/public_html/: -rw-rw-r-- auser auser ...httpd_sys_content_t 1.html -rw-rw-r-- auser auser ...httpd_sys_content_t 2.html -rw-rw-r-- auser auser ...httpd_sys_content_t 3.html -rw-rw-r-- auser auser ...httpd_sys_content_t 4.html -rw-rw-r-- auser auser ...httpd_sys_content_t 5.html -rw-rw-r-- auser auser ...httpd_sys_content_t index.html /tmp/web_files/: -rw-rw-r-- auser auser user_u:object_r:user_home_t 1.html -rw-rw-r-- auser auser user_u:object_r:user_home_t 2.html -rw-rw-r-- auser auser user_u:object_r:user_home_t 3.html -rw-rw-r-- auser auser user_u:object_r:user_home_t 4.html -rw-rw-r-- auser auser user_u:object_r:user_home_t 5.html -rw-rw-r-- auser auser user_u:object_r:user_home_t \ index.html
star
, the archive expands on that same path. For example, an archive made with this command restores the files to /var/log/httpd/
:
star -xattr -H=exustar -c -f httpd_logs.star /var/log/httpd/
star
issues a warning if the files in the path are newer than the ones in the archive.
sestatus
command provides a configurable view into the status of SELinux. The simplest form of this command shows the following information:
~]# sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 21
Policy from config file: targeted
-v
option includes information about the security contexts of a series of files that are specified in /etc/sestatus.conf
:
~]# sestatus -v
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 21
Policy from config file: targeted
Process contexts:
Current context: user_u:system_r:unconfined_t
Init context: system_u:system_r:init_t
/sbin/mingetty system_u:system_r:getty_t
/usr/sbin/sshd system_u:system_r:unconfined_t:s0-s0:c0.c1023
File contexts:
Controlling term: user_u:object_r:devpts_t
/etc/passwd system_u:object_r:etc_t
/etc/shadow system_u:object_r:shadow_t
/bin/bash system_u:object_r:shell_exec_t
/bin/login system_u:object_r:login_exec_t
/bin/sh system_u:object_r:bin_t -> system_u:object_r:shell_exec_t
/sbin/agetty system_u:object_r:getty_exec_t
/sbin/init system_u:object_r:init_exec_t
/sbin/mingetty system_u:object_r:getty_exec_t
/usr/sbin/sshd system_u:object_r:sshd_exec_t
/lib/libc.so.6 system_u:object_r:lib_t -> system_u:object_r:lib_t
/lib/ld-linux.so.2 system_u:object_r:lib_t -> system_u:object_r:ld_so_t
-b
displays the current state of booleans. You can use this in combination with grep or other tools to determine the status of particular booleans:
~]# sestatus -b | grep httpd | grep on$
httpd_builtin_scripting on
httpd_disable_trans on
httpd_enable_cgi on
httpd_enable_homedirs on
httpd_unified on
init
process to perform the relabeling, ensuring that applications have the correct labels when they are started and that they are started in the right order. If you relabel a file system without rebooting, some processes may continue running with an incorrect context. Manually ensuring that all the daemons are restarted and running in the correct context can be difficult.
touch /.autorelabel
reboot
init.rc
checks for the existence of /.autorelabel
. If this file exists, SELinux performs a complete file system relabel (using the /sbin/fixfiles -f -F relabel
command), and then deletes /.autorelabel
.
fixfiles
command, or to relabel based on the RPM database:
fixfiles
command:
fixfiles relabel
fixfiles -R <packagename>
restore
fixfiles
to restore contexts from packages is safer and quicker.
fixfiles
on the entire file system without rebooting may make the system unstable.
fixfiles relabel
prompts for approval to empty /tmp/
because it is not possible to reliably relabel /tmp/
. Since fixfiles
is run as root, temporary files that applications are relying upon are erased. This could make the system unstable or behave unexpectedly.
nfs_t
type, which is not a type that httpd_t
is allowed to execute.
nfs_t
, try mounting the home directories with a different context:
mount -t nfs -o context=user_u:object_r:user_home_dir_t \
fileserver.example.com:/shared/homes/ /home
httpd
can execute scripts. If you do this for user home directories, it gives the Apache HTTP Server increased access to those directories. Remember that a mountpoint label applies to the entire mounted file system.
root_t
, tmp_t
, and usr_t
that grant read access for a directory. These types are suitable for directories that do not contain any confidential information, and that you want to be widely readable. They could also be used for a parent directory of more secured directories with different contexts.
avc: denied
message, there are some common problems that arise with directory traversal. For example, many programs run a command equivalent to ls -l /
that is not necessary to their operation but generates a denial message in the logs. For this you need to create a dontaudit
rule in your local.te
file.
path=/
component. This path is not related to the label for the root file system, /
. It is actually relative to the root of the file system on the device node. For example, if your /var/
directory is located on an LVM (Logical Volume Management [22]) device, /dev/dm-0
, the device node is identified in the message as dev=dm-0
. When you see path=/
in this example, that is the top level of the LVM device dm-0
, not necessarily the same as the root file system designation /
.
setenforce
command to change between permissive and enforcing modes at runtime. Use setenforce 0
to enter permissive mode; use setenforce 1
to enter enforcing mode.
sestatus
command displays the current mode and the mode from the configuration file referenced during boot:
~]# sestatus | grep -i mode
Current mode: permissive
Mode from config file: permissive
~]#setenforce 1
~]#sestatus | grep -i mode
Current mode: enforcing Mode from config file: permissive
named
daemon and SELinux, you can turn off enforcing for just that daemon.
getsebool
command to get the current status of the boolean:
~]# getsebool named_disable_trans
named_disable_trans --> off
~]#setsebool named_disable_trans 1
~]#getsebool named_disable_trans
named_disable_trans --> on
-P
option to make the change persistent across reboots.
~]# getsebool -a | grep disable.*on
httpd_disable_trans=1
mysqld_disable_trans=1
ntpd_disable_trans=1
setsebool
command:
setsebool -P httpd_disable_trans=1 mysqld_disable_trans=1 ntpd_disable_trans=1
togglesebool <boolean_name>
to change the value of a specific boolean:
~]#getsebool httpd_disable_trans
httpd_disable_trans --> off ~]#togglesebool httpd_disable_trans
httpd_disable_trans: active
setenforce(1)
, getenforce(1)
, and selinuxenabled(1)
commands.
/etc/sysconfig/selinux
file. This file is a symlink to /etc/selinux/config
. The configuration file is self-explanatory. Changing the value of SELINUX
or SELINUXTYPE
changes the state of SELinux and the name of the policy to be used the next time the system boots.
~]# cat /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=permissive
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
# SETLOCALDEFS= Check local definition changes
SETLOCALDEFS=0
Disabled
, Enforcing
or Permissive
, and then click .
Enabled
to Disabled
or vice versa, you need to restart the machine for the change to take effect.
/etc/sysconfig/selinux
.
/etc/sysconfig/selinux
:
SELINUXTYPE=<policyname>
<policyname>
is the policy name directory under /etc/selinux/
. This assumes that you have the custom policy installed. After changing the SELINUXTYPE
parameter, run the following commands:
touch /.autorelabel
reboot
/etc/selinux
.
mount -o context=
command to set a single context for an entire file system. This might be a file system that is already mounted and that supports xattrs, or a network file system that obtains a genfs label such as cifs_t
or nfs_t
.
httpd_sys_content_t
:
mount -t nfs -o context=system_u:object_r:httpd_sys_content_t \
server1.example.com:/shared/scripts /var/www/cgi
httpd
and SELinux problems, reduce the complexity of your situation. For example, if you have the file system mounted at /mnt
and then symbolically linked to /var/www/html/foo
, you have two security contexts to be concerned with. Because one security context is of the object class file and the other of type lnk_file, they are treated differently by the policy and unexpected behavior may occur.
runcon
command to run a command in a specific context. This is useful for scripting or for testing policy, but care should be taken to ensure that it is implemented correctly.
~/bin/contexttest
is a user-defined script.)
runcon -t httpd_t ~/bin/contexttest -ARG1 -ARG2
runcon user_u:system_r:httpd_t ~/bin/contexttest
getenforce
setenforce [ Enforcing
| Permissive
| 1
| 0
]
1
or Enforcing
tells SELinux to enter enforcing mode. The option 0
or Permissive
tells SELinux to enter passive mode. Access violations are still logged, but not prevented.
selinuxenabled
0
if SELinux is enabled, and 1
if SELinux is disabled.
~]#selinuxenabled
~]#echo $?
0
getsebool [-a] [boolean_name
]
-a
) or a specific boolean (<boolean_name>
).
setsebool [-P] <boolean_name> value | bool1=val1 bool2=val2 ...
-P
option makes the changes persistent across reboots.
togglesebool boolean ...
newrole
command to run a new shell with the specified type and/or role. Changing roles is typically only meaningful in the strict policy; the targeted policy is generally restricted to a single role. Changing types may be useful for testing, validation, and development purposes.
newrole -r <role_r>
-t <type_t>
[-- [ARGS]...]
ARGS
are passed directly to the shell specified in the user's entry in the /etc/passwd
file.
newrole
command is part of the policycoreutils-newrole
package, which is required if you install the strict or MLS policy. It is not installed by default in Red Hat Enterprise Linux.
audit=1
parameter to your kernel boot line, either in the /etc/grub.conf
file or on the GRUB menu at boot time.
httpd
is denied access to ~/public_html
because the directory is not labeled as Web content. Notice that the time and serial number stamps in the audit(...) field are identical in each case. This makes it easier to track a specific event in the audit logs:
Jan 15 08:03:56 hostname kernel: audit(1105805036.075:2392892): \ avc: denied { getattr } for pid=2239 exe=/usr/sbin/httpd \ path=/home/auser/public_html dev=hdb2 ino=921135 \ scontext=user_u:system_r:httpd_t \ tcontext=system_u:object_r:user_home_t tclass=dir
Jan 15 08:03:56 hostname kernel: audit(1105805036.075:2392892): \ syscall=195 exit=4294967283 a0=9ef88e0 a1=bfecc0d4 a2=a97ff4 \ a3=bfecc0d4 items=1 pid=2239 loginuid=-1 uid=48 gid=48 euid=48 \ suid=48 fsuid=48 egid=48 sgid=48 fsgid=48
Jan 15 08:03:56 hostname kernel: audit(1105805036.075:2392892): \ item=0 name=/home/auser/public_html inode=921135 dev=00:00
/var/log/messages
, such as /var/log/audit/audit.log
.
selinux-policy-targeted-sources
packages and then to create a local.te
file in the /etc/selinux/targeted/src/policy/domains/misc
directory. You could use the audit2allow
utility to translate the AVC messages into allow rules, and then rebuild and reload the policy.
selinux-policy-XYZ.src.rpm
. A further package, selinux-policy-devel
, has also been added, which provides further customization functionality.
semodule
.
semodule
is the tool used to manage SELinux policy modules, including installing, upgrading, listing and removing modules. You can also use semodule
to force a rebuild of policy from the module store and/or to force a reload of policy without performing any other transaction. semodule
acts on module packages created by semodule_package
. Conventionally, these files have a .pp suffix (policy package), although this is not mandated in any way.
semodule -l
command:
~]# semodule -l
amavis 1.1.0
ccs 1.0.0
clamav 1.1.0
dcc 1.1.0
evolution 1.1.0
iscsid 1.0.0
mozilla 1.1.0
mplayer 1.1.0
nagios 1.1.0
oddjob 1.0.1
pcscd 1.0.0
pyzor 1.1.0
razor 1.1.0
ricci 1.0.0
smartmon 1.1.0
/usr/share/selinux/targeted/
directory contains a number of policy package (*.pp) files. These files are included in the selinux-policy
rpm and are used to build the policy file.
ypbind init
script, which executes the setsebool
command, which in turn tries to use the terminal. This is generating the following denial:
type=AVC msg=audit(1164222416.269:22): avc: denied { use } for pid=1940 comm="setsebool" name="0" dev=devpts ino=2 \ scontext=system_u:system_r:semanage_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=fd
audit2allow
utility now has the ability to build policy modules. Use the following command to build a policy module based on specific contents of the audit.log
file:
ausearch -m AVC --comm setsebool | audit2allow -M mysemanage
audit2allow
utility has built a type enforcement file (mysemanage.te
). It then executed the checkmodule
command to compile a module file (mysemanage.mod
). Lastly, it uses the semodule_package
command to create a policy package (mysemanage.pp
). The semodule_package
command combines different policy files (usually just the module and potentially a file context file) into a policy package.
cat
command to inspect the contents of the TE file:
~]# cat mysemanag.te
module mysemanage 1.0;
require {
class fd use;
type init_t;
type semanage_t;
role system_r;
};
allow semanage_t init_t:fd use;
module
command, which identifies the module name and version. The module name must be unique. If you create an semanage
module using the name of a pre-existing module, the system would try to replace the existing module package with the newly-created version. The last part of the module line is the version. semodule
can update module packages and checks the update version against the currently installed version.
require
block. This informs the policy loader which types, classes and roles are required in the system policy before this module can be installed. If any of these fields are undefined, the semodule
command will fail.
dontaudit
, because semodule
does not need to access the file descriptor.
semodule
command to load the policy package:
~]# semodule -i mysemanage.pp
mysemanage.pp
) to other machines and install it using semodule
.
audit2allow
command outputs the commands it executed to create the policy package so that you can edit the TE file. This means you can add new rules as required or change the allow
rule to dontaudit
. You could then recompile and repackage the policy package to be installed again.
차례
고친 과정 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
고침 10-0 | Thu Jul 21 2011 | |||||||||||
| ||||||||||||
고침 9-0 | Thu Jan 13 2011 | |||||||||||
| ||||||||||||
고침 8-0 | Thu July 30 2010 | |||||||||||
| ||||||||||||
고침 7-0 | Wed Sep 30 2009 | , , | ||||||||||
| ||||||||||||
고침 7-0 | Mon Sep 14 2009 | |||||||||||
| ||||||||||||
고침 6-0 | Wed Sep 02 2009 | |||||||||||
| ||||||||||||
고침 5-0 | Wed Jan 28 2009 | |||||||||||
|