100% found this document useful (1 vote)
180 views

Linux Quick Reference

This document provides a quick reference for Linux system administration tasks. It lists important configuration files for setting the hostname, networking, user management, and file sharing. It also provides commands for common tasks like mounting filesystems, starting services, and configuring printers. The document serves as a handy checklist of files and commands for system administrators to configure key aspects of a Linux system.

Uploaded by

api-3744861
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
180 views

Linux Quick Reference

This document provides a quick reference for Linux system administration tasks. It lists important configuration files for setting the hostname, networking, user management, and file sharing. It also provides commands for common tasks like mounting filesystems, starting services, and configuring printers. The document serves as a handy checklist of files and commands for system administrators to configure key aspects of a Linux system.

Uploaded by

api-3744861
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

/etc/HOSTNAME HOSTNAME=hostname.domain.

com
LINUX Administrator’s /etc/NETWORKING
hostname is set by “/bin/hostname” during
(Slackware)
Quick Reference Card boot and the name is read from these files.
May change manually. NFS File Sharing
Jialong He /etc/sysconfig/network
[email protected] (Redhat) Files
http://www.bigfoot.com/~jialong_he specify name server, DNS domain and /etc/fstab file systems mounted during boot.
search order. For Example: /etc/exports NFS server export list.
etc/resolv.conf
User Management search la.asu.edu
/etc/auto.master auto mount master file.
nameserver 129.219.17.200
Files /etc/hosts host name to IP mapping file. Commands
/etc/group host name information look up order. mount mount a file system or all entries in fstab.
/etc/passwd User account information. Example:
/etc/shadow /etc/host.conf exportfs export file system listed in exports
order hosts, bind
/etc/bashrc multi on showmount –e show file systems exported
/etc/profile hostname
BASH system wide and per user init files. /etc/nsswitch.conf new way to specify information source.
$HOME/.bashrc
$HOME/.bash_profile /etc/networks
/etc/csh.cshrc
/etc/protocols TCP/IP services and ports mapping. Printer Configuration
/etc/services
/etc/csh.login
/etc/rpc RPC service name to their program numbers
Files
$HOME/.cshrc TCSH system wide and per user init files.
mapping. /etc/printcap
$HOME/.tcshrc Printer capabilities data base.
/etc/printcap.local
$HOME/.login
Commands /etc/lpd.conf LPRng configuration file.
/etc/skel template files for new users.
netconfig menu driven Ethernet setup program. permissions control file for the LPRng line
/etc/default default for certain commands. /etc/lpd.perms
pppsetup setup PPP connection (Slackware). printer spooler
/etc/redhat-release Redhat and Slackware version info (Linux
setup Ethernet during boot, for example /etc/hosts.lpd Access control (BSD lpd).
/etc/slackware-version kernel version with “uname –a”)
/etc/hosts.equiv trusted hosts.
Commands /sbin/ifconfig eth0 ${IPADDR} broadcast
PRINTER Environment variable of default printer.
${BROADCAST} netmask ${NETMASK}
script to create an new user interactively /dev/lp0 parallel port.
adduser ifconfig
(slackware) or link to useradd (Redhat). /sbin/route add -net ${NETWORK} netmask
useradd, userdel, create, delete, modify an new user or update ${NETMASK} eth0 Commands
usermod default new user information.. line printer control program, print queue
/sbin/route add default gw ${GATEWAY} netmask lpc, lpq, lprm
newusers update and create new users (batch mode). maintain
0.0.0.0 metric 1
groupadd, groupdel,
add, delete or modify group. host lookup host name or IP (similar to nslookup).
groupmod
dnsdomainname show DNS domain name.
Sendmail
modify account policy (password length,
chage. chfn, chsh
expire data etc.) or finger information (full arping; arp find out Ethernet address by first arping then arp. Files
name, phone number etc.) change default login ipchains firewall and NAT (/etc/sysconfig/ipchains on Redhat) “sendmail.cf” is the configuration file. “sendmail.mc” is
shell. sendmail.cf
iptables firewall and NAT (/etc/sysconfig/iptables on Redhat) a macro file which can be used to generate “sendmail.cf”
sendmail.mc
gain root access during boot prompt without by: m4 sendmail.mc > sendmail.cf
linux init=/bin/sh rw ntsysv menu driven SYSV service configuration (Redhat)
password, can be used to fix some problems. mail aliases, must run “newaliases” after change. use
mount –w -n –o remount / chkconfig command line SYSV service configuration (Redhat) aliases
:include: to include external list in a file.
makebootdisk per user aliases, use \yourname to prevent further expand
make a bootable floppy disk .forward
and keeps a copy in mailbox.
Redhat files in /etc/sysconfig
mail access control, FEATURE(access_db) should be set
Network Configuration Configuration Files in sendmail.mc. For example, in /etc/mail/access
keyboard map, e.g., cyberpromo.com REJECT
Files keyboard access mydomain.com RELAY
KEYBOARD=”/usr/lib/kdb/keytables/us.map”
[email protected] DISCARD
/etc/rc.d/rc.inet1 Mouse type, e.g.,
(Slackware) IP address, Network mask, Default gateway mouse MOUSETYPE=Microsoft
makemap hash /etc/mail/access < /etc/mail/access
/etc/sysconfig/nework- are in these files. May edit manually to XEMU3=yes
scripts/ifcfg-eth0 (Redhat) modify network parameters. /etc/mail/relay-
network settings, contains list all host/domain accepted for relaying.
network domains
NETWORKING=yes
Commands Manage Modules unset TMOUT disable BASH auto-logout feature
unset autologout disable TCSH auto-logout feature
newaliases rebuild the data base for the mail aliases file. insmod, lsmod, modinfo,
modprobe, rmmod, Manage loadable modules. kudzu probe for new hardware (Redhat).
build access database, e.g,
makemap depmod rpm -i INSTALL a package
makemap hash access.db<access
rpm -e UNINSTALL a package
Rpm
rpm -q QUERY a package
Useful Configuration Files Miscellaneous rpm -U UPDATE a package

Files Files man cmd | col –b


save a man page as a text file and remove control
characters.
/etc/shells allowed login shells >cmd.txt
httpd.conf Apache web server configuration file.
lilo.conf LILO boot loder configuration file. /etc/ftpusers user names NOT allowed to use ftp. Run ntop and listen on web port 3000. View traffic
syslog.conf System log daemon (syslogd) configuration. /etc/hosts.allow Ntop –w 3000 with browser to http://hostsname:3000
TCP wrapper access control files.
/etc/hosts.deny
ssh_config SSH client and server configuration files.
sshd_config /etc/sysconfig
contains system configuration files.
(redhat)
ld.so.conf default dynamic library search path (run
/dev/fd0 floppy drive A
Configure Apache 2.0 with SSL
ldconfig).
mtools.conf mtool configuration file (access DOS file). /etc/inittab mod_ssl
system run level control file.
/etc/init.d (1) when compile apache, specify –enable-ssl for configure script.
named.conf DNS name server (BIND). By default, ssl is not enabled. After compiling, use “httpd –l”
sysctl.conf kernel parameters by sysctl (Redhat). Commands to list the modules. “mod_ssl” should be in them.
ntp.conf net time server. fromdos, todos (2) generate private key with command:
(Slackware) openssl genrsa -out server.key 1024
inetd.conf Internet super server. convert text file from/to linux format.
dos2unix, unix2dos
Xinetd.conf, Xinet.d Extended inetd configuration. (Redhat) (3) generate certificate request
directory openssl req -new -key server.key -out server.csr
pwck, grpck verify integrity of password and group files.
proftpd.conf proftpd FTP server.
pwconv, (4) generate self-signed certificate
amanda.conf network backup server. pwunconv, openssl x509 -req -days 60 -in server.csr -signkey server.key -out
convert to and from shadow passwords and groups.
/etc/pine.conf PINE mail client system wide settings. grpconv, server.crt
/etc/pine.conf.fixed grpuncov
shadowconfig toggle shadow passwords on and off. (5) modify “ssl.conf” which is included in “httpd.conf”. To start web
server with SSL support , use “httpd –DSSL” or “apachectl startssl”,
quota,
Rebuild Kernel edquota,
otherwise, commented out <IfDefine SSL> in ssl.conf.
Configure Kernel Parameters quotacheck,
Manage disk quota. (*) Trouble shoot SSl connection with command
quotaon,
Unpack the tarball in /usr/src directory openssl s_client –connect yourhost.yourdomain.com:443
quotaoff,
make config bzip2 -dc linux-2.4.0.tar.bz2 | tar xvf – repquota,
make menuconfig
make xconfig Configuring the kernel with interactive, menu lilo -D dos set LILO default OS (default=dos in lilo.conf) Syslog.conf
or X window interface. ldd find out shared library dependencies.
Each line consists of a selector and an action. A selector has two parts:
Compile Kernel Source lsof list opened files.
facilities and priorites, separated by a period (.),You may precede every
fuser filename show processes that using the file. priority with an equation sign (``='') to specify only this single priority
Building and installing a new kernel.
ifdown and not any of the above. You may also (both is valid, too) precede the
bring up/down a network interface (Redhat) priority with an exclamation mark (``!'') to ignore all that priorities, either
cp arch/i386/boot/bzImage /boot/bzImage- ifup
make dep exact this one or this and any higher priority.
KERNEL_VERSION sysctl configure kernel parameters (Redhat).
make zImage
make zdisk socklist list opened socked. Example:
cp System.map /boot/System.map- mail.notice /var/log/mail # log to a file
make zlilo shutdown [–r|h]
KERNEL_VERSION *.emerg @myhost.mydomain.org # log to remote host
make bzImage now reboot / halt computer
ln -s /boot/System.map-KERNEL_VERSION Note: separator between first column and second colume (log file name)
/boot/System.map nmap scan a host for opened ports. must be TAB, not spaces.
Compile Modules crontab show or edit cron jobs.
facilities
auth, auth-priv, cron, daemon, kern, lpr, mail, mark,
sys-unconfig unconfigure system news, syslog, user, uucp, local0 – local7.
make modules
Building and installing modules. priorities debug, info, notice, warning, err, crit, alert, emerg.
make modules_install chkconfig --list list services started at different run level.
Regular File: /etc/cups iptables [-t <table >] <command> <chain > <parameters>
action
File with full pathname beginning with “/”. /usr/lib/cups CUPS related directories
/usr/share/cups Save and Restore rules
Terminal and Console:
/sbin/iptables-save > /etc/sysconfig/iptables
Specify a tty, same with /dev/console.
/sbin/iptables-restore < /etc/sysconfig/iptables
Remote Machine:
@myhost.mydomain.org Samba File and Printer Sharing
Firewall script sample
Introduction http://tiger.la.asu.edu/iptables_examples.htm
Printing with CUPS Samba provides file and printer sharing with MS Windows computers. It Build-in Table
Introduction makes UNIX speaks SMB/ICFS file and printer sharing protocol. The latest
version of samba can be downloaded from
filter This is the default table for handling network packets. Build-
in chains are:
Common Unix Printing System (CUPS) is the default printing system on http://www.samba.org. 1. INPUT — This chain applies to packets received
most Linux distributions. Samba is controlled by a configuration file “smb.conf”. On Redhat Linux, via a network interface.
one can use “redhat-config-samba” to modify the configuration file. On 2. OUTPUT — This chain applies to packets sent
If your system does not have CUPS preinstalled or you want the latest other systems, SWAT is a web based GUI interface. SWAT is run from out via the same network interface which received
version, you may download it from http://www.cups.org. You have to “inetd” and listen to port 901. You just need point your browser to the packets.
download CUPS package, and optionally ESP Ghostscript package if you http://localhost:901 after starting swat. 3. FORWARD — This chain applies to packets
don’t have a Postscript printer. received on one network interface and sent out on
Commands another.
You compile and install both packages with nat This table used to alter packets that create a new connection.
configure; (see configure –help) To test if the syntax of “smb.conf” is correct, use
Build-in chains:
make; testparm smb.conf 1. PREROUTING — This chain alters packets
make install List shares on a Samba or Windows server
received via a network interface when they arrive.
smbclient –L machinename -U username
2. OUTPUT — This chain alters locally-generated
The printing daemon “/usr/sbin/cupsd” is controlled by a configuration file Connect to a Samba or Windows server and get/put files using FTP like
packets before they are routed via a network
“/etc/cups/cupsd.conf”. The syntax of this file is similar to Apache’s commands:
interface.
httpd.conf. Normally, you don’t need to modify this file. smbclient //machinename/sharename -U username
3. POSTROUTING — This chain alters packets
before they are sent out via a network interface.
You can start “cupsd” directly or use a system starting script (e.g., rc.cups Security Mode in “smb.conf” ## Masquerade everything out ppp0.
start). iptables -t nat -A POSTROUTING -o ppp0 -j
security = user
In this (default) security mode, samba maintain its own user login database MASQUERADE
You can manage printers with a GUI program from KDE/GNOME, web
interface or command lines. which is usually in /etc/samba/smbpasswd. This file is created with
command /usr/sbin/smbpasswd. Note, the user login file and command have ## Change source addresses to 1.2.3.4.
lpadmin -p myprint -E -v parallel:/dev/lp0 –m laserjet.ppd the same name but in different directories. Following settings are used: iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to
lpadmin -p myprint -E -v socket://11.22.33.44 -m myprint.ppd 1.2.3.4
lpadmin -p myprint -E -v lpd://11.22.33.44/ -m myprint.ppd encrypt passwords = yes mangle This table is used for specific types of packet alteration.
smb passwd file = /etc/samba/smbpasswd Build-in chains:
The about commands add a printer connected to (1) local parallel port, (2) 1. PREROUTING — This chain alters packets
JetDirect printer, and (3) LPD printer. –m option specifying a Postscript received via a network interface before they are
security = domain
Printing Definition (PPD) files. CUPS has a few PPD files preinstalled. In In this security mode, samba server must join to an NT domain (using net routed.
order to use full features of your printer, you may need to find a proper PPD
file and put it in “/usr/share/cups/model” directory.
command) and authenticate users by a domain controller. A user must have 2. OUTPUT — This chain alters locally-generated
both valid UNIX and NT account in order to access files. packets before they are routed via a network
kcmshell printmgr KDE printer manager interface.
http://localhost:631 CUPS web administration interface security = server
lpadm –d myprint -d option set a printer as default
Use another computer (NT or W2k) to authenticate users. No need to join a
domain. Need to specify a login server:
Commands
lpadm –x myprint -x option delete a installed printer.
password server = mywin.domain.com --flush | -F Flush (delete) rules in the selected chain.
enable/disable
Control printing queue --policy | -P Set default policy for a particular chain.
accept/reject security = share
Give each share a password, no user name needed. --list | -L List all rules in filter table, use [–t tablename] to
lpadmin –p myprint –P
Change PPD file specify other tables.
another.PPD
Display associate PPD --append | -A A appends a rule to the end of the specified chain.
lpoptions –p myprint -l
IPtables (Netfilter) -insert | -I Inserts a rule in a chain at a particular point.
lpinfo –v List supported printing protocols
/etc/cups/printers.conf
Command Syntax Other commands:
/etc/cups/classes.conf CUPS related configuration files (1) --new | -N (2) --delete | -D (3) --replace | -D (4) --zero | -Z
/etc/cups/cupsd.conf (5) –check | -C (6) delete-chain | -X (7) rename-chain | -E
$HOME/.xinitrc FontPath "path"
Parameters /etc/X11/xinit/xinitrc Font path elements may be either absolute directory paths, or a font server
/etc/X11/xinit/xinitrc.d scripts run after X server started identifier
--proto | -p [!] name protocol: by number or name, including tcp, $HOME/.Xclients
udp, icmp or all. RGBPath "path"
/etc/X11/xinit/Xclients Sets the path name for the RGB color database.
--source | -s [!] addr/mask source IP address. decide which desktop (GNORM, KDE) to start
/etc/sysconfig/desktop ModulePath "path"
--destination | -d addr/mask destination IP address. (Redhat). (by /etc/X11/prefdm) Allows you to set up multiple directories to use for storing modules loaded
--in-interface | -i incoming interface name, e.g. eth0 or ppp0. /etc/X11/fs/config configuration of X11 font path (font server). by the XFree86 server.
--out-interface | -o outgoing interface name. EXAMPLE
Commands Section "Files"
--jump | -j jump to a particular target when matching a
rule. Standard options: ACCEPT, DROP, startx start X window system. RgbPath "/usr/X11R6/lib/X11/rgb"
QUEUE, RETURN, REJECT. May jump Xconfigurator FontPath "unix/:7100"
to a user defined chain. (Redhat) EndSection
xfree86setup setup X server and generate XF86config.
--fragment | -f match second or further fragments only.
(Slackware) Serverflags Section
Options for TCP and UDP protocol xf86config Option "DontZap" "boolean"
Disable use Ctrl+Alt+Backspace to terminate X server.
XFreee86 auto configuration (Plug-n-Play),
XFree86 -configure
--sport | --source-port source and/or destination port. Can specify a generate a template named “XF86Config.new” Option "DontZoom" "boolean"
--dport | destination-port range like 0:65535, use exclamation Ctrl+Alt+Del stop X server (on some system Ctrl+Alt+ESC). Disable use ‘Ctrl+Alt+Keypad +’ and ‘Ctrl+Alt+Keypad -’ to switch video
character (!) to NOT match ports. mode.
Ctrl+Alt+F1 F1 temporary switch to text mode, F7 switch
Option "BlankTime" "time"
Options for TCP only Ctrl+Alt+F7 back to graphic mode.
Sets the inactivity timeout for the blanking phase of the screensaver in
SuperProbe detect graphic hardware. minutes. Default 10 min.
--syn Match SYN packets. xvidtune adjust X server origin and size. Option "StandbyTime" "time"
--tcp-flags Match TCP packets with specific bits set. For example, -p xmodmap modifying key map and mouse button map. Sets the inactivity timeout for the "standby" phase of DPMS mode in
tcp –tcp-flags ACK,FIN,SYN SYN will only match TCP minutes. Default 20 min.
packets that have the SYN flag set and the ACK and FIN xhost server access control program for X.
flags unset. xsetroot root window parameter setting utility for X. Option "SuspendTime" "time"
Sets the inactivity timeout for the "suspend" phase of DPMS mode, default
xlsfonts server font list displayer for X.
Options for ICMP only xset ser preference utility for X.
30 min.
Option "OffTime" "time"
--icmp-type [!] type Match specified ICMP type. Valid ICMP type can be Sets the inactivity timeout for the "off" phase of DPMS mode, default 40
list by min.
iptables –p icmp -h XF86Config Option "DefaultServerLayout" "layout_id"
XFree86 uses a configuration file called XF86Config for its initial setup.
Option for state module (-m state --state)
Specify the default ServerLayout section to use. Default is the first
This file is normally located in “/etc/X11” or “/etc” directory. The ServerLayout section.
XF86Config file is composed of a number of sections which may be EXAMPLE
ESTABLISHED The matching packet is associated with other
present in any order. Each section has the form: Section "ServerFlags"
packets in an established connection.
Option "BlankTime" "99999"
RELATED The matching packet is starting a new connection Section "SectionName" Option "StandbyTime" "99999"
related in some way to an existing connection. SectionEntry Option "SuspendTime" "99999"
NEW The matching packet is either creating a new ... Option "OffTime" "99999"
connection or is part of a two-way connection not EndSection EndSection
previously seen.
The graphics boards are described in the Device sections, and the monitors
INVALID The matching packet cannot be tied to a known
are described in the Monitor sections. They are bound together by a Screen
connection.
section. Keyboard and Mouse are described in InputDevice sections, Module Section
although Keyboard and Pointer are still recognized. ServerLayout section Load "modulename"
is at the highest level and bind together the InputDevice and Screen Load a module. The module name given should be the module's standard
X Window (XFree86) sections. name, not the module file name.
Files EXAMPLE
A special keyword called Option may be used to provide free-form data to Section "Module"
To set screen resolution, in “Screen” section and Subsection “Display”, various components of the server. The Option keyword takes either one or
specify a mode. For example: Modes “1024x768” Load "extmod"
two string arguments. The first is the option name, and the optional second Load "type1"
argument is the option value. All Option values must be enclosed in quotes. EndSection
To specify screen refresh rate, in “Monitor” section, specify vertical rate.
For example: VertRefresh 70-120 File Section
InputDevice Section EXAMPLE ServerLayout Section
Section "Monitor"
There are normally at least two InputDevice sections, one for Keyboard and Identifier "Generic Monitor " ServerLayout section binds a Screen section and one or more InputSection
one for Mouse. VendorName "Monitor Vendor" to form a complete configuration. The active ServerLayout section is
Identifier ModelName "Monitor Model" specified in ServerFlags. If not, the first ServerLayout section is active. If no
Specify an unique name for this input device. HorizSync 31.5-56.6 ServerLayout sections are present, the single active screen and two active
VertRefresh 40-70 (core) input devices are selected as described in the relevant sections.
Driver
EndSection Identifier
Specify the name of the driver to use for this input device..
An unique name for this ServerLayout Section.
Option "CorePointer"
This input device is installed as the primary pointer device. Screen screen-num "screen-id" position-information
Option "CoreKeyboard"
Screen Section The screen-id field is mandatory, and specifies the Screen section being
referenced.
This input device is the primary Keyboard. Screen Section binds Device and Monitor sections. There must be at least
one Screen Section. The active one is in ServerLayout section. InputDevice "idev-id" "option" ...
EXAMPLE Normally at least two are required, one for the core pointer and the other for
Section "InputDevice" Identifier the primary keyboard devices.
Identifier "Generic Keyboard" Specify an unique name for this Screen Section.
Driver "keyboard" EXAMPLE
Device "device-id" Section "ServerLayout"
Option "AutoRepeat" "500 30" This specifies the Identifier of Device section to be used for this screen.
Option "CoreKeyboard" Identifier "Default Layout"
EndSection Monitor "monitor-id" Screen "My Screen"
This specifies the Identifier of Monitor section to be used for this screen. InputDevice "Generic Keyboard"
Section "InputDevice" DefaultDepth depth InputDevice "PS/2 Mouse"
Identifier "PS2 Mouse" Default color depth, like 8, 16 or 24. EndSection
Driver "mouse" Option "Accel"
Option "CorePointer" Enables XAA (X Acceleration Architecture), default is ON.
Option "Device" "/dev/mouse"
Option "Protocol" "PS/2" DISPLAY SUBSECTION Boot Sequences
Each Screen section must have at least one Display Subsection which
Option "Emulate3Buttons" "true"
EndSection
matches the depth values in DefaultDepth. Redhat
Depth depth Usually the Linux kernel file is /boot/vmlinuz and is loaded by a boot
This entry specifies what color depth of this Display Subsection. loder (e.g., LILO). The first process created by the kernel is /sbin/init. It
uses a configuration file /etc/inittab. init process runs /etc/rc.d/rc.sysinit
Device Section Virtual xdim ydim
script first, then runs all scripts in /etc/rc.d/rcN.d, where N is the default
Specifies the virtual screen resolution to be used. run level defined in inittab. The actual scripts are stored in /etc/rc.d/init.d
Specifies information about the video card used by the system. You must
have at least one Device section in your configuration file. The active device ViewPort x0 y0 and proper links are created in run level directoris to point to
is in ServerLayout->Screen. Sets the upper left corner of the initial display. corresponding scripts in init.d directory. The last script to run is
/etc/rc.d/rc.local.
Identifier Modes "mode-name" ...
Specify an unique name for this graphics card. Secifies the list of video modes to use. Each mode-name specified must be Run level 1: Single user mode
Driver in double quotes. They must correspond to those specified in the appropriate Run level 3: Multiuser mode
Specify the name of the driver to use for this graphics card. Monitor section (including implicitly referenced built-in ESA standard Run level 5: Multiuser model with X11
modes). mode can be switched with Ctrl+Alt+Keypad-Plus or
EXAMPLE
Section "Device" Ctrl+Alt+Keypad-Minus. Slackware
Identifier "ATI Mach64" EXAMPLE In Slackware, Linux kernel is /boot/vmlinuz and the first process started
VendorName "ATI MACH64" Section "Screen" by the kernel is /sbin/init. Its configuration file is /etc/inittab. init first
VideoRam 2048 Identifier "My Screen” runs script /etc/rc.d/rc.S, then runs /etc/rc.K for single user mode or
EndSection Device " ATI Mach64" /etc/rc.M for multiuser mode. The last script to run is /etc/rc.d/rc.local.
Monitor " Generic Monitor"
DefaultDepth 16 rc.S calls scripts (rc.modules, rc.pcmcia, rc.serial and rc.sysvinit).
Monitor Section SubSection "Display" rc.M calls scripts (rc.inet1, rc.inet2, rc.httpd, rc.samba) and start some
Depth 16 network server (lpd, httpd etc.)
Monitor section describes a monitor. There must be at least one monitor Modes "1024x768" "800x600" "640x480" rc.inet1 sets IP address, Mask, and default Gateway.
section and the active one is used in ServerLayout->Screen. EndSubSection
Identifier SubSection "Display"
Specify an unique name for this monitor. Depth 24 Run level 1: Single user mode
Modes "1024x768" "800x600" "640x480" Run level 3: Multiuser mode
HorizSync horizsync-range Run level 4: Multiuser model with X11
Gives the range(s) of horizontal sync frequencies of this monitor in kHz. EndSubSection
EndSection
VertRefresh vertrefresh-range
Gives the range(s) of vertical sync frequencies of this monitor in Hz. GRUB boot loader
chainloader +1
Introduction
More Linux distributions use GRUB as their boot loader instead of LILO. #===================
If your system does not have GRUB preinstalled, it can be downloaded # GRUB2
from http://www.gnu.org/software/grub/ #===================
set timeout=10
The newer version of GRUB (called GRUB2) is totally rewritten and uses set default=0
somewhat different syntax than Ver 0.xxx (called GRUB Legacy). After
unpacking GRUN, compile and install it with following commands: # Entry 0 - Load Linux kernel
./configure menuentry "Linux" {
make set root=(hd1, 0)
make install linux /boot/vmlinuz root=/dev/hda2
initrd /initrd
First test GRUB by creating a bootable floppy disk with command }
grub-install /dev/fd0 # Entry 1 - Chainload another bootloader
menuentry "Windows" {
Suppose you have Windows installed on the first hard disk and Linux on set root=(hd0, 0)
the second disk, boot with just created floppy and type following chainloader +1
commands }
=== Boot Linux ===
grub> root (hd1,0)
grub> kernel /boot/vmlinuz
(or linux /boot/vmlinuz if using GRUB2)
grub> boot

=== Boot Windows ===


grub>rootnoverify(hd0, 0)
chainloader +1
boot

Other Useful GRUB commands


ls Display disks and partitions
configfile
Display boot menu
(hd1,0)/boot/grub.conf
Display a file content, can figure out which
partition was used as root partition in an
cat (hd1, 0)/etc/fstab
unbootable system, then pass root parameter
in “kernel” command
help List available commands

Sample GRUB configuration file


#===================
# GRUB ver 0.xxx
#===================
default=0
timeout=10
splashimage=(hd1,2)/grub/splash.xpm.gz
title Linux
root (hd1,0)
kernel /boot/vmlinuz

title Windows XP
rootnoverify (hd0,0)

You might also like