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