LINUX Administrator's Quick Reference Card: User Management NFS File Sharing
LINUX Administrator's Quick Reference Card: User Management NFS File Sharing
/etc/rc.d/rc.netdevice
/etc/modules.conf
Jialong He
Jialong_he@bigfoot.com
http://www.bigfoot.com/~jialong_he
User Management
Files
/etc/group
/etc/passwd
/etc/shadow
/etc/bashrc
/etc/profile
$HOME/.bashrc
$HOME/.bash_profile
/etc/HOSTNAME
/etc/NETWORKING
(Slackware)
/etc/sysconfig/network
(Redhat)
/etc/auto.master
/etc/hosts
Commands
mount
/etc/host.conf
exportfs
showmount e
hostname
etc/resolv.conf
/etc/skel
/etc/default
/etc/rpc
/etc/redhat-release
/etc/slackware-version
newusers
linux init=/bin/sh rw
makebootdisk
Commands
netconfig
pppsetup
groupadd, groupdel,
groupmod
ifconfig
host
/etc/printcap
/etc/printcap.local
/etc/lpd.conf
/etc/lpd.perms
/etc/hosts.lpd
/etc/hosts.equiv
trusted hosts.
PRINTER
/dev/lp0
parallel port.
Commands
ipchains
iptables
ntsysv
chkconfig
/etc/rc.d/rc.inet1
(Slackware)
/etc/sysconfig/neworkscripts/ifcfg-eth0 (Redhat)
Printer Configuration
Files
Network Configuration
Files
IP address, Network mask, Default gateway
are in these files. May edit manually to
modify network parameters.
/etc/networks
/etc/protocols
/etc/services
useradd, userdel,
usermod
/etc/exports
/etc/nsswitch.conf
network
/etc/fstab
adduser
/etc/csh.cshrc
/etc/csh.login
$HOME/.cshrc
$HOME/.tcshrc
$HOME/.login
Commands
mouse
Sendmail
Files
sendmail.cf
sendmail.mc
aliases
.forward
access
spam@somewhere.com DISCARD
makemap hash /etc/mail/access < /etc/mail/access
/etc/mail/relaylist all host/domain accepted for relaying.
domains
/boot/System.map
Compile Modules
make modules
make modules_install
Manage Modules
Commands
newaliases
makemap
lilo.conf
Miscellaneous
Files
/etc/shells
/etc/ftpusers
/etc/hosts.allow
/etc/hosts.deny
/etc/sysconfig
(redhat)
syslog.conf
ssh_config
sshd_config
ld.so.conf
/dev/fd0
floppy drive A
mtools.conf
/etc/inittab
/etc/init.d
named.conf
sysctl.conf
ntp.conf
inetd.conf
Xinetd.conf, Xinet.d
directory
proftpd.conf
amanda.conf
/etc/pine.conf
/etc/pine.conf.fixed
Rebuild Kernel
Configure Kernel Parameters
make config
make menuconfig
make xconfig
cp arch/i386/boot/bzImage /boot/bzImageKERNEL_VERSION
cp System.map /boot/System.mapKERNEL_VERSION
ln -s /boot/System.map-KERNEL_VERSION
Commands
fromdos, todos
(Slackware)
convert text file from/to linux format.
dos2unix, unix2dos
(Redhat)
nmap
crontab
sys-unconfig
unconfigure system
chkconfig --list
unset TMOUT
unset autologout
kudzu
Rpm
pwck, grpck
pwconv,
pwunconv,
grpconv,
grpuncov
shadowconfig
quota,
edquota,
quotacheck,
quotaon,
quotaoff,
repquota,
lilo -D dos
Syslog.conf
ldd
lsof
fuser filename
ifdown
ifup
sysctl
socklist
shutdown [r|h]
now
Each line consists of a selector and an action. A selector has two parts:
facilities and priorites, separated by a period (.),You may precede every
priority with an equation sign (``='') to specify only this single priority
and not any of the above. You may also (both is valid, too) precede the
priority with an exclamation mark (``!'') to ignore all that priorities, either
exact this one or this and any higher priority.
Example:
mail.notice
*.emerg
Note: separator between first column and second colume (log file name)
must be TAB, not spaces.
http://localhost:631
lpadm d myprint
lpadm x myprint
enable/disable
accept/reject
security = user
In this (default) security mode, samba maintain its own user login database
which is usually in /etc/samba/smbpasswd. This file is created with
command /usr/sbin/smbpasswd. Note, the user login file and command have
the same name but in different directories. Following settings are used:
Facilities
lpadmin p myprint P
another.PPD
Priorities
lpoptions p myprint -l
Regular File:
File with full pathname beginning with /.
lpinfo v
lp d myprint filename
lpr P myprint filename
Print a file
cancel id
lprm id
/etc/cups/printers.conf
/etc/cups/classes.conf
/etc/cups/cupsd.conf
security = server
Use another computer (NT or W2k) to authenticate users. No need to join a
domain. Need to specify a login server:
password server = mywin.domain.com
Introduction
/etc/cups
/usr/lib/cups
/usr/share/cups
security = share
Give each share a password, no user name needed.
Action
Introduction
Samba provides file and printer sharing with MS Windows computers. It
makes UNIX speaks SMB/ICFS file and printer sharing protocol. The latest
version of samba can be downloaded from
http://www.samba.org.
Samba is controlled by a configuration file smb.conf. On Redhat Linux,
one can use redhat-config-samba to modify the configuration file. On
other systems, SWAT is a web based GUI interface. SWAT is run from
inetd and listen to port 901. You just need point your browser to
http://localhost:901 after starting swat.
IPtables (Netfilter)
Command Syntax
iptables [-t <table >] <command> <chain > <parameters>
Save and Restore rules
/sbin/iptables-save > /etc/sysconfig/iptables
/sbin/iptables-restore < /etc/sysconfig/iptables
Firewall script sample
http://tiger.la.asu.edu/iptables_examples.htm
Build-in Table
filter
This is the default table for handling network packets. Buildin chains are:
1.
INPUT This chain applies to packets received
via a network interface.
2.
OUTPUT This chain applies to packets sent
out via the same network interface which received
the packets.
3.
FORWARD This chain applies to packets
received on one network interface and sent out on
another.
nat
Commands
To test if the syntax of smb.conf is correct, use
testparm smb.conf
List shares on a Samba or Windows server
smbclient L machinename -U username
Connect to a Samba or Windows server and get/put files using FTP like
commands:
smbclient //machinename/sharename -U username
Commands
--flush | -F
--policy | -P
--list | -L
--append | -A
-insert | -I
Other commands:
(1) --new | -N (2) --delete | -D (3) --replace | -D (4) --zero | -Z
(5) check | -C
(6) delete-chain | -X
(7) rename-chain | -E
list by
iptables p icmp -h
RELATED
NEW
INVALID
X Window (XFree86)
Files
XFree86 uses a configuration file called XF86Config for its initial setup.
This file is normally located in /etc/X11 or /etc directory. The
XF86Config file is composed of a number of sections which may be
present in any order. Each section has the form:
Section "SectionName"
SectionEntry
...
EndSection
The graphics boards are described in the Device sections, and the monitors
are described in the Monitor sections. They are bound together by a Screen
section. Keyboard and Mouse are described in InputDevice sections,
although Keyboard and Pointer are still recognized. ServerLayout section
is at the highest level and bind together the InputDevice and Screen
sections.
File Section
FontPath "path"
Font path elements may be either absolute directory paths, or a font server
identifier
$HOME/.xinitrc
/etc/X11/xinit/xinitrc
/etc/X11/xinit/xinitrc.d scripts run after X server started
$HOME/.Xclients
/etc/X11/xinit/Xclients
source IP address.
/etc/sysconfig/desktop
/etc/X11/fs/config
Parameters
XF86Config (xorg.conf)
RGBPath "path"
Sets the path name for the RGB color database.
ModulePath "path"
Allows you to set up multiple directories to use for storing modules loaded
by the XFree86 server.
--in-interface | -i
--out-interface | -o
Commands
--jump | -j
startx
Xconfigurator
(Redhat)
xfree86setup
(Slackware)
xf86config
EXAMPLE
Section "Files"
RgbPath "/usr/X11R6/lib/X11/rgb"
FontPath "unix/:7100"
EndSection
Serverflags Section
XFree86 -configure
Ctrl+Alt+Del
Ctrl+Alt+F1
Ctrl+Alt+F7
SuperProbe
xvidtune
xmodmap
xhost
xsetroot
xlsfonts
xset
--fragment | -f
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
is in ServerLayout->Screen.
DISPLAY SUBSECTION
Each Screen section must have at least one Display Subsection which
matches the depth values in DefaultDepth.
EXAMPLE
Section "ServerFlags"
Option "BlankTime" "99999"
Option "StandbyTime" "99999"
Option "SuspendTime" "99999"
Option "OffTime" "99999"
EndSection
Identifier
Specify an unique name for this graphics card.
Depth depth
This entry specifies what color depth of this Display Subsection.
Driver
Specify the name of the driver to use for this graphics card.
Module Section
EXAMPLE
Section "Device"
Identifier
"ATI Mach64"
VendorName "ATI MACH64"
VideoRam
2048
EndSection
Load "modulename"
Load a module. The module name given should be the module's standard
name, not the module file name.
Monitor Section
EXAMPLE
Section "Module"
Load
"extmod"
Load
"type1"
EndSection
InputDevice Section
There are normally at least two InputDevice sections, one for Keyboard and
one for Mouse.
Identifier
Specify an unique name for this input device.
Driver
Specify the name of the driver to use for this input device..
Option "CorePointer"
This input device is installed as the primary pointer device.
VertRefresh vertrefresh-range
Gives the range(s) of vertical sync frequencies of this monitor in Hz.
EXAMPLE
Section "Monitor"
Identifier "Generic Monitor "
VendorName "Monitor Vendor"
ModelName "Monitor Model"
HorizSync 31.5-56.6
VertRefresh 40-70
EndSection
Option "CoreKeyboard"
This input device is the primary Keyboard.
EXAMPLE
Section "InputDevice"
Identifier
"Generic Keyboard"
Driver
"keyboard"
Option "AutoRepeat" "500 30"
Option
"CoreKeyboard"
EndSection
Section "InputDevice"
Identifier
"PS2 Mouse"
Driver
"mouse"
Option
"CorePointer"
Option
"Device"
"/dev/mouse"
Option
"Protocol"
"PS/2"
Option
"Emulate3Buttons" "true"
EndSection
Device Section
ServerLayout Section
Screen Section binds Device and Monitor sections. There must be at least
one Screen Section. The active one is in ServerLayout section.
Identifier
Specify an unique name for this Screen Section.
Identifier
An unique name for this ServerLayout Section.
Device "device-id"
This specifies the Identifier of Device section to be used for this screen.
Screen Section
Monitor "monitor-id"
This specifies the Identifier of Monitor section to be used for this screen.
DefaultDepth depth
Default color depth, like 8, 16 or 24.
Option "Accel"
Enables XAA (X Acceleration Architecture), default is ON.
Boot Sequences
Redhat
More Linux distributions are using GRUB as the boot loader instead of
LILO. GRUB can be downloaded from http://www.gnu.org/software/grub/
The newer version of GRUB (called GRUB2) is totally rewritten and uses
somewhat different syntax than Ver 0.xxx (called GRUB Legacy). After
unpacking GRUN, compile and install it with following commands:
./configure
make
make install
grub-install /dev/fd0
Slackware
In Slackware, Linux kernel is /boot/vmlinuz and the first process started
by the kernel is /sbin/init. Its configuration file is /etc/inittab. init first
runs script /etc/rc.d/rc.S, then runs /etc/rc.K for single user mode or
/etc/rc.M for multiuser mode. The last script to run is /etc/rc.d/rc.local.
rc.S calls scripts (rc.modules, rc.pcmcia, rc.serial and rc.sysvinit).
rc.M calls scripts (rc.inet1, rc.inet2, rc.httpd, rc.samba) and start some
network server (lpd, httpd etc.)
rc.inet1 sets IP address, Mask, and default Gateway.
Run level 1: Single user mode
Run level 3: Multiuser mode
Run level 4: Multiuser model with X11
Suppose you have Windows installed on the first hard disk and Linux on
the second disk, boot with just created floppy, when grub> prompt
appears, type following 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
geometry(hd0)
configfile
Display boot menu
(hd1,0)/boot/grub/grub.conf
cat (hd1, 0)/etc/fstab
help
Introduction
#===================
# GRUB2
#===================
set timeout=10
set default=0
# Entry 0 - Load Linux kernel
menuentry "Linux" {
set root=(hd1,0)
linux /boot/vmlinuz root=/dev/hda2
initrd /initrd
}
# Entry 1 - Chainload another bootloader
menuentry "Windows" {
set root=(hd0,0)
chainloader +1
}