eventually proceed with a brutal network setup – avoid ssh host keys generation for darkstar

beware of escapes in da place

short=TARGET-SHORT-HOSTNAME

cat lala/etc/HOSTNAME # noexist yet or darkstar.example.net
echo $short > lala/etc/HOSTNAME

mv lala/etc/hosts lala/etc/hosts.dist
cat > lala/etc/hosts <<-EOF
127.0.0.1   localhost
IP-ADDRESS      $short.localdomain $short
GW-ADDRESS      gw
EOF

mv -i lala/etc/rc.d/rc.inet1 lala/etc/rc.d/rc.inet1.dist
chmod -x lala/etc/rc.d/rc.inet1.dist
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 x.x.x.x/xx up && echo done

    echo -n default route...
    route add default gw x.x.x.x && echo done
fi
EOF
chmod +x lala/etc/rc.d/rc.inet1

cat > lala/etc/resolv.conf <<-EOF
#search example.net
nameserver 62.210.16.6
nameserver 62.210.16.7
#nameserver 208.67.222.222
#nameserver 208.67.220.220
EOF

don’t forget to put your pubkeys over there

mkdir lala/root/.ssh/
vi lala/root/.ssh/authorized_keys

PASTE PUBKEYS

chmod 700 lala/root/.ssh/
chmod 600 lala/root/.ssh/authorized_keys

eventually a better SSHD

# REC but forcibly installed by slackinst/minimal
ls -lF lala/etc/rc.d/rc.sshd # already executable

we want to trust he right curve algo on first connection

mv -i lala/etc/ssh/sshd_config lala/etc/ssh/sshd_config.dist
grep -vE '^[[:space:]]*(#|$)' lala/etc/ssh/sshd_config.dist > lala/etc/ssh/sshd_config
echo 'HostKey /etc/ssh/ssh_host_ed25519_key' >> lala/etc/ssh/sshd_config
cat lala/etc/ssh/sshd_config