Debian Wheezy Post Install Customization

I have been using Debian Testing (Wheezy) installer disks for a while now, and every time I do a fresh install I have to manually customize it. This list is the things which I customize. During installation, I don’t even install Standard utilities, preferring to install only what I need (a real minimal install).

Install Necessary Packages

su -
aptitude install vim sudo less ssh

Configure default editor

Once you have installed vim, you may want to enable it as the default editor

su -
update-alternatives --config editor

You will be presented a list of installed editors and you can choose “vim basic” from it.

Add user for sudo


Add the following line to the file, under User privilege specification

codeghar ALL=(ALL:ALL) ALL

INIT: Id “co” respawning too fast: disabled for 5 minutes

If you see this message popping up all the time, do the following:

sudo sed -e 's/^co:2345/#co:2345/g' -i /etc/inittab

This comments out the line with ‘co’ in it. Now tell init to re-examine the inittab file

sudo init q

Configure SSH

Backup the config file first

sudo cp /etc/ssh/sshd_config /etc/ssh/bkp.sshd_config

Disable root login

sudo sed -e 's/^PermitRootLogin yes$/#PermitRootLogin yes\nPermitRootLogin no/g' -i /etc/ssh/sshd_config

Don’t use DNS

sudo sh -c "echo 'UseDNS no' >> /etc/ssh/sshd_config"

Only allow certain users to login via SSH

sudo sh -c "echo 'AllowUsers codeghar' >> /etc/ssh/sshd_config"

Setup Aliases

I always setup a standard set of aliases to make things easier for me.

vim ~/.bash_aliases

And I put the following lines in the file:

alias update="sudo aptitude update"
alias upgrade="sudo aptitude dist-upgrade"
alias install="sudo aptitude install"
alias search="aptitude search"
alias show="aptitude show"

An alternative is to run the following series of commands:

echo 'alias update="sudo aptitude update"' >> ~/.bash_aliases
echo 'alias upgrade="sudo aptitude dist-upgrade"' >> ~/.bash_aliases
echo 'alias install="sudo aptitude install"' >> ~/.bash_aliases
echo 'alias search="aptitude search"' >> ~/.bash_aliases
echo 'alias show="aptitude show"' >> ~/.bash_aliases

Change from ‘wheezy’ to ‘testing’ (optional)

Change the apt source.list file, replacing ‘wheezy’ with ‘testing’. This way I can continue to use the ‘testing’ branch, even after ‘wheezy’ is made ‘stable’.

sudo sed -e 's/ wheezy/ testing/g' -i /etc/apt/sources.list

After changing, run the following commands. The first command updates apt database/cache/etc. based on ‘testing’ and the second command upgrades your system (if necessary).

sudo aptitude update

sudo aptitude dist-upgrade

Setup static IP (optional)

If you want to setup static IP address, you need to modify /etc/network/interfaces file. You can run the following commands to do so.

sudo sed -e 's/^allow-hotplug eth0/#allow-hotplug eth0/g' -e 's/^iface eth0 inet dhcp/#iface eth0 inet dhcp/g' -i /etc/network/interfaces

sudo sh -c "echo 'auto eth0' >> /etc/network/interfaces"

sudo sh -c "echo 'iface eth0 inet static' >> /etc/network/interfaces"

sudo sh -c "echo 'address' >> /etc/network/interfaces"

sudo sh -c "echo 'netmask' >> /etc/network/interfaces"

sudo sh -c "echo 'gateway' >> /etc/network/interfaces"

2 Responses to Debian Wheezy Post Install Customization

  1. Pingback: Links 7/9/2011: Linux World Domination, China Picks IBM’s GNU/Linux Mainframe | Techrights

  2. John says:

    Nice bit of information. Like you, I don’t install a complete desktop, although it sounds like your environment is leaner than mine.
    I found you looking for some information on the new version of sudo – my old config file is no longer valid.

%d bloggers like this: