RedHat/CentOS System Administration


ISO

Hostname

  • /etc/hosts
  • /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain
GATEWAY=192.168.111.1

Release

  • /etc/redhat-release

Locale

  • /etc/sysconfig/i18n

Network

  • DNS
cat >/etc/resolv.conf <<DELIM
nameserver 8.8.8.8
DELIM
  • ifcfg
cat >/etc/sysconfig/network-scripts/ifcfg-eth0 <<DELIM
DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.111.255
HWADDR=D8:D3:85:A9:C6:34
IPADDR=192.168.111.77
NETMASK=255.255.255.0
NETWORK=192.168.111.0
ONBOOT=yes
DELIM
  • static route
cat >/etc/sysconfig/network-scripts/route-eth0 <<DELIM
192.168.111.0/24 via 192.168.111.1 dev eth0
DELIM

Autorun

  • /etc/rc.local

tcpd

  • /etc/hosts.allow
  • /etc/hosts.deny

ssh-agent

eval `ssh-agent`
ssh-add ~/.ssh/id_rsa

/etc/profile

export TMOUT=300 #shell timeout

64位系统上移除32位软件包

yum remove \*.i\?86
cat >>/etc/yum.conf <<DELIM
[main]
exclude = *.i?86
DELIM