Brutal slackware network setup

beware of escapes in da place

as for dedislack or xen guest - otherwise built into slackstart already

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

echo rc.inet1 PATH is \$PATH

if [[ \$1 != stop && \$1 != down ]]; then
    echo -n lo...
    ifconfig lo up && echo done

    #dhclient -v eth0
    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
    #dhclient -r
    route delete default
    ifconfig eth0 down
    ifconfig lo down
vi lala/etc/rc.d/rc.inet1
chmod +x lala/etc/rc.d/rc.inet1

avoid ssh host keys generation for darkstar

cat lala/etc/HOSTNAME #noexist yet or
echo $guest > lala/etc/HOSTNAME
mv lala/etc/hosts lala/etc/hosts.dist
cat > lala/etc/hosts <<-EOF   localhost
IP-ADDRESS      $guest.localdomain $guest
GW-ADDRESS      gw
vi lala/etc/hosts

cat > lala/etc/resolv.conf <<-EOF
vi lala/etc/resolv.conf

push your pub key over there

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

#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

Nethence | Pub | Lab | Pbraun | SNE Russia | xhtml