Based on the article Installing Debian using only SSH :
Your headless machine should be set to boot off CD for this procedure to work.
A. Download your netinst cd image variant, for example :
wget http://cdimage.debian.org/debian-cd/6.0.4/i386/iso-cd/debian-6.0.4-i386-netinst.iso
B. Mount the ISO to a folder, let’s call it isoorig
mkdir isoorig
mount -o loop -t iso9660 debian-6.0.4-i386-netinst.iso isoorig
C. Extract to new folder called isonew
mkdir isonew<br>
rsync -a -H –exclude=TRANS.TBL isoorig/ isonew
D. Change the menu to load SSH on boot by default
/isonew# nano isolinux/txt.cfg
DELETE: remove "menu default" from "label install"
ADD:
label netinstall
menu label ^Install Over SSH
menu default
kernel /install.386/vmlinuz
append auto=true vga=normal file=/cdrom/preseed.cfg initrd=/install.386/initrd.gz locale=en_US console-keymaps-at/keymap=us
CHANGE: "default install" to "default netinstall"
EDIT both files below and change “timeout 0″ to “timeout 4″ to make it auto select netinstall
nano isolinux/isolinux.cfg
nano isolinux/prompt.cfg
E. Create preseed.cfg file
nano isonew/preseed.cfg
F. PASTE this to the preseed file:
#### Contents of the preconfiguration file
### Localization
# Locale sets language and country.
d-i debian-installer/locale select en_US
# Keyboard selection.
d-i console-keymaps-at/keymap select us
### Network configuration
# netcfg will choose an interface that has link if possible. This makes it
# skip displaying a list if there is more than one interface.
d-i netcfg/choose_interface select auto
# Any hostname and domain names assigned from dhcp take precedence over
# values set here. However, setting the values still prevents the questions
# from being shown, even if values come from dhcp.
d-i netcfg/get_hostname string newdebian
d-i netcfg/get_domain string local
# Disable that annoying WEP key dialog.
d-i netcfg/wireless_wep string
# The wacky dhcp hostname that some ISPs use as a password of sorts.
#d-i netcfg/dhcp_hostname string radish
d-i preseed/early_command string anna-install network-console
# Setup ssh password
d-i network-console/password password install
d-i network-console/password-again password install
G. Recreate md5sum.txt file
md5sum `find -follow -type f` > md5sum.txt
H. Create your new iso image
mkisofs -o ../custom_install.iso -r -J -no-emul-boot -boot-load-size 4 -boot-info-table -b isolinux/isolinux.bin -c isolinux/boot.cat ../isonew
The image should be ready to burn. This loads everything automatically and goes to the SSH screen.