Setting up Slackware Linux

do not forget the Y set

Warning

The required steps to proceed with change slightly depending on your scenario:

In the first case, eventually enable ssh root password auth temporarily just to push operator’s public keys there.

Installation (physical host)

Network Setup

check the hostname,

hostname

#handled by rc.M
cat /etc/HOSTNAME

static name resolution,

cp -pi /etc/hosts hosts.dist
vi /etc/hosts

127.0.0.1       localhost
x.x.x.x slack.example.local slack
x.x.x.x gw.example.local    gw
#PUBLICIP   slack.example.com   slack

DNS,

cat /etc/resolv.conf
cat > /etc/resolv.conf <<-EOF
search example.local
nameserver 208.67.222.222
nameserver 208.67.220.220
EOF

ping -W1 -c1 opendns.com

identify your network interfaces as usual with either mii-tool or ethtool, and setup the network,

mv -i /etc/rc.d/rc.inet1 /etc/rc.d/rc.inet1.dist
chmod -x /etc/rc.d/rc.inet1.dist
vi /etc/rc.d/rc.inet1

#!/bin/bash

echo rc.inet1 PATH is $PATH

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

chmod +x /etc/rc.d/rc.inet1

apply and check,

/etc/rc.d/rc.inet1
ping -W1 -c1 208.67.222.222

Remote Shell

Upload your SSH keys somehow,

export TERM=xterm
cd ~/
mkdir .ssh/
chmod 700 .ssh/
vi .ssh/authorized_keys
chmod 600 .ssh/authorized_keys

Push your public KEY there and switch back to without-password.

export TERM=xterm
cp -pi /etc/ssh/sshd_config /etc/ssh/sshd_config.dist
vi /etc/ssh/sshd_config

AllowGroups wheel
PermitRootLogin without-password
StrictModes yes
PasswordAuthentication no
X11Forwarding no

diff -u /etc/ssh/sshd_config.dist /etc/ssh/sshd_config
/etc/rc.d/rc.sshd restart

System Tuning

Proceed with some further tweaking,

cat /etc/rc.d/rc.local_shutdown
cat > /etc/rc.d/rc.local_shutdown <<-EOF
#!/bin/bash
#nothing here yet
EOF
chmod +x /etc/rc.d/rc.local_shutdown

ln -s rc.d/rc.local /etc/rc.local #already executable
ln -s rc.d/rc.local_shutdown /etc/rc.local_shutdown

cd /etc/rc.d/
ls -alkF
chmod -x rc.bluetooth rc.fuse rc.inetd

Note. keeping rc.udev because without it, I get this error when trying to SSH,

PTY allocation request failed on channel 0

LILO (physical host)

cd /etc/
cp -pi lilo.conf lilo.conf.dist
vi lilo.conf

lba32
...
#timeout = 1200
timeout = 100

lilo

Environment

cd /etc/
cp -pi profile profile.dist
vi profile

# SYSTEM-WIDE PATH
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/etc/rc.d:$HOME/bin:/usr/games"
#and eventually remove the user-specific part

#source /etc/shrc
export ENV=/etc/shrc

Either with BASH,

vi /etc/shrc #new file

case "$-" in *i*)
    [[ -z $HOST ]] && HOST=`uname -n`
    (( `id -u` == 0 )) && PS1='$HOST# ' || PS1='$HOST> '

    alias ll='ls -alhF'
    alias l='ls -altrhF'
    #alias cp='cp -i'
    #alias mv='mv -i'
    #alias rm='rm -i'

    alias netstata='netstat -antupe --inet --inet6'
    alias runq='postfix flush'

    alias lynxg='lynx -accept_all_cookies google.com/ncr'
    alias lynx='lynx -accept_all_cookies'

    alias push='git nc && git push'
    alias stat='git diff --stat --cached origin/master'

    export TERM=xterm
    #export TERM=linux

    j=$((`grep ^processor /proc/cpuinfo | tail -1 | awk '{print $3}'` + 1))
    export MAKEFLAGS=-j$j
    unset j
    ;;
esac

Or with KSH,

cat /etc/shells
chsh -s /bin/ksh root
useradd -D -s /bin/ksh

vi shrc #continue

keybd_trap () {
  case ${.sh.edchar} in
    $'\f')    .sh.edchar=$'\e\f';;  # clear-screen (THIS QUESTION)
    $'\e[1~') .sh.edchar=$'\001';;  # Home = beginning-of-line
    $'\e[4~') .sh.edchar=$'\005';;  # End = end-of-line
    $'\e[5~') .sh.edchar=$'\e>';;   # PgUp = history-previous
    $'\e[6~') .sh.edchar=$'\e<';;   # PgDn = history-next
    $'\e[3~') .sh.edchar=$'\004';;  # Delete = delete-char
  esac
}

case "$-" in *i*)
        ( set -o emacs 2>/dev/null ) && set -o emacs
        ( set -o tabcomplete 2>/dev/null ) && set -o tabcomplete
        trap keybd_trap KEYBD
        ...
esac

Ref. https://tutel.me/c/unix/questions/272591/how+to+make+ctrl++l+to+clear+screen+in+ksh+under+red+hat+linux

And apply,

#source /etc/profile
^D

Miscellaneous

indexing,

updatedb

fixing defaults for git,

git config --global core.pager "less -r"
#git config --global --replace-all core.pager more
git config --global alias.nc 'commit -a --allow-empty-message -m ""'

doing some hardware checking,

grep '^model name' /proc/cpuinfo | uniq
grep ^proc /proc/cpuinfo
free -m
hdparm -Tt /dev/sda | tee -a /var/tmp/hdparm.sda
#hdparm -Tt /dev/xvda | tee -a /var/tmp/hdparm.xvda
#hdparm -Tt /dev/xvda1 | tee -a /var/tmp/hdparm.xvda1

Virtual Terminals (physical host)

this was already done for the slackware/xen guest setup.

I find it convenient to see what happened lately on the console, and if you really want to hide it, just ^L before you ^D.

cd /etc
mv -i inittab inittab.dist
sed 's/agetty 38/agetty --noclear 38/' inittab.dist > inittab
diff -bu inittab.dist inittab

Packages

setting up Slackpkg,

cp -pi /etc/slackpkg/mirrors /etc/slackpkg/mirrors.dist
vi /etc/slackpkg/mirrors

(uncomment your favorite mirrors // do not use your own mirror unless daily syncing)

disable dialog,

cp -pi /etc/slackpkg/slackpkg.conf /etc/slackpkg/slackpkg.conf.dist
vi /etc/slackpkg/slackpkg.conf

DIALOG=off

applying latest patches,

slackpkg update
slackpkg upgrade-all
==> (K)eep

updatedb
locate \.new | grep new$
for f in `locate \.new | grep new$`; do
    diff -bu ${f%\.new} $f
done; unset f

#slackpkg install-new
#slackpkg clean-system

sbopkg

assuming the D set has been installed (and not just the ADD tag)

setting up SlackBuilds e.g. building and installing bonnie++, fetch and install the latest sbopkg package e.g.,

cd /var/tmp/
#git clone https://github.com/sbopkg/sbopkg.git
wget https://github.com/sbopkg/sbopkg/releases/download/0.38.1/sbopkg-0.38.1-noarch-1_wsr.tgz
installpkg sbopkg-0.38.1-noarch-1_wsr.tgz 
sbopkg -r

#ADD
#slackpkg install patch gcc-g++
#REC
slackpkg install guile
sbopkg -i bonnie++

useradd -m bonnie -s /sbin/nologin
cd /home/bonnie/
bonnie++ -u bonnie | tee -a /var/tmp/bonnie++

alternative with slackpkg+

fetch the latest slackpkg+ and install it,

#https://github.com/zuno/slackpkgplus
wget http://slakfinder.org/slackpkg+/pkg/slackpkg+-1.7.0-noarch-6mt.txz
installpkg slackpkg+-1.7.0-noarch-6mt.txz 

enabling other repositories,

cd /etc/slackpkg
cp -pi slackpkgplus.conf slackpkgplus.conf.dist
vi slackpkgplus.conf

REPOPLUS=( slackpkgplus restricted alienbob slacky )
#REPOPLUS=( slackpkgplus restricted alienbob slacky multilib )

# ***COMMENT THIS OUT***:
#REPOPLUS=( slackpkgplus )

MIRRORPLUS[...
MIRRORPLUS[...

slackpkg update gpg
slackpkg update