eventually proceed with a brutal network setup – avoid ssh host keys generation for darkstar
beware of escapes in da place
short=SHORT-HOSTNAME # kvm/libvirt ip=192.168.122.99/24 gw=192.168.122.1 dns1=192.168.122.1 cat lala/etc/HOSTNAME # darkstar.example.net echo $short > lala/etc/HOSTNAME mv lala/etc/hosts lala/etc/hosts.dist echo -e "127.0.0.1\t\tlocalhost.localdomain localhost" > lala/etc/hosts echo -e "::1\t\t\tlocalhost.localdomain localhost" >> lala/etc/hosts echo -e "${ip%/*}\t\t$short.localdomain $short" >> lala/etc/hosts [[ -n $gw ]] && echo -e "$gw\t\tgw" >> lala/etc/hosts for dns in dns1 dns2 dns3; do [[ -n ${!dns} ]] && echo -e "${!dns}\t\t$dns" >> lala/etc/hosts done; unset dns ls -lF lala/etc/rc.d/rc.inet1 # no exist #mv -i lala/etc/rc.d/rc.inet1 lala/etc/rc.d/rc.inet1.dist #chmod -x lala/etc/rc.d/rc.inet1.dist # WARNING ESCAPES ARE IN THERE cat > lala/etc/rc.d/rc.inet1 <<EOF #!/bin/bash echo rc.inet1 PATH is \$PATH if [[ \$1 = stop || \$1 = down ]]; then route delete default ifconfig eth0 down ifconfig lo down else echo -n lo ... ifconfig lo up && echo done echo -n eth0 ... ifconfig eth0 $ip up && echo done echo -n default route ... route add default gw $gw && echo done fi EOF chmod +x lala/etc/rc.d/rc.inet1 ls -lF lala/etc/resolv.conf # no exist #mv -i lala/etc/resolv.conf lala/etc/resolv.conf.dist for dns in dns1 dns2 dns3; do [[ -n ${!dns} ]] && echo -e "nameserver ${!dns}" >> lala/etc/resolv.conf done; unset dns
don’t forget to put your pubkeys over there
mkdir lala/root/.ssh/ vi lala/root/.ssh/authorized_keys PASTE PUBKEYS chmod 600 lala/root/.ssh/authorized_keys chmod 700 lala/root/.ssh/