Thursday, February 17, 2005

 

Trimming down Woody

During install:
  1. rm -r /target/tmp/* after kernel and modules install, before installing base
  2. cd /target/var/cache/apt/packages; rm * after packages are installed (be sure to do it on proper time)
I got debian woody down to 62 MB by:
  1. only installed the base system, didn't run tasksel
  2. only listing main and no source packages in apt.sources (every package repository wastes a lot of disk space, alternatively you can turn off package caches in /etc/apt.conf),
  3. apt-get install localepurge; localepurge
  4. apt-get clean
  5. apt-get --purge remove man.* dhcp-client groff-base ipchains nano ppp.* tasksel base-config modconf
  6. rm -r /usr/share/{doc*,man*,info,locale} /usr/doc /usr/lib/gconv # remove docs etc
  7. using syslog to log to a remote host (alternative: use agressive log removal strategy)
  8. building a custom static kernel (no modules, /lib/modules was a whopping 12 MB)
Other things to consider:
  1. strip all binaries
What I did to setup and secure the box after install:
  1. echo -e 'map! jj \033' > /root/.exrc # make vi more carpal-friendly
  2. firewall: transfered the firewall scripts from another box
  3. disabled inetd (you can't remove it as net-base depends on it):
    $ update-rc.d inetd stop 20 2 3 4 5 .
    (and edit /etc/inetd.conf to be sure everything is OK when it is accidenally started)
  4. apt-get install wget ssh sudo
  5. DNS serving: compiled ucspi-tcp, daemontools, djbdns and zonenotify in another box and installed these, also compiled and installed dnsmasq from testing.
  6. disable root login via ssh and create a sudo user with all privileges, avoid su from now on

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?