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
#!/bin/bash

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

avoid ssh host keys generation for darkstar

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

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
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