Slackware Linux configuration

Home | UNIX | Oracle | Code | Practical | Private

Slackware Linux configuration

pbraun.nethence.com/doc/sysutils_linux/slackware.html
pbraun.nethence.com/doc/sysutils_linux/slackware-pkgsrc.html
pbraun.nethence.com/doc/sysutils_linux/slackware_slackinst.html
(FR) pbraun.nethence.com/doc/sysutils_linux/slackware_dedibox.html


Installation
For a very minimal slackware installation, use slackinst (pbraun.nethence.com/doc/sysutils_linux/slackware_slackinst.html), otherwise get those sets installed (ADD + REC tags are enought),
A
AP
D
L
N
T
Note. D for gcc, make and kernel-headers
Note. L for loads of libraries
Note. K, F (and T?) sets aren't on the first CDrom

Post-installation briefing
In brief :
- lilo
- network
- environment
- users
- syslog
- time & date
- misc
- custom wrappers


LILO
Keep it simple,
cd /etc
vi lilo.conf
like,
append=" vt.default_utf8=0"
boot = /dev/sda
prompt
timeout = 30
change-rules
reset
#vga = normal

image = /boot/vmlinuz
root = /dev/sda3
label = Linux
read-only
Note. 30 = 3 seconds


Network
Eventually proceed manually instead of using 'netconfig'. Define $fqdn, $ip, $mask, $gw, $dns and $dns2 and proceed,
  cd /etc/rc.d
cat >> rc.inet1 <<EOF9

defroute=\`route -n | grep ^0.0.0.0\`
[[ -n \$defroute ]] && delroute="route delete default"
echo -n ip/mask...
ifconfig eth0 $ip netmask $mask up && echo done
echo -n gw...
\$delroute
route add default gw $gw && echo done
unset alreadydone defroute delroute
EOF9
enable,
chmod +x rc.inet1

Note. eventually disable the wireless init script,
chmod -x rc.wireless

Configure those as usual,
cd /etc
#vi nsswitch.conf
vi hosts
vi resolv.conf


Environment
Placing those at root dir in case we end up in rescue mode without HOME defined,
cd /
ls -l .bash_profile .bashrc .vimrc
wget pbraun.nethence.com/code/shells/.bash_profile
wget pbraun.nethence.com/code/shells/.bashrc
wget pbraun.nethence.com/code/shells/.vimrc
chown root:wheel .bash_profile .bashrc .vimrc
chmod 664 .bash_profile .bashrc .vimrc

Make the symlinks in root's home dir,
cd ~/
ls -l .bash_profile .bashrc .vimrc
ln -s /.bash_profile
ln -s /.bashrc
ln -s /.vimrc

Note. we're keeping slackware's default /etc/profile and /etc/profile.d/* settings, while adding those on top of it.
Note. and eventually uncomment some distro-specific settings,
#vi .bashrc

Apply,
cd ~/
source .bashrc


Users
Configure skeletons,
cd /etc
mv skel skel.dist
mkdir skel
cd /etc/skel
ln -s /.bash_profile
ln -s /.bashrc
ln -s /.vimrc

Update your root password,
passwd root

Configure the default group for users,
useradd -D -g users

Create an admin user,
useradd -m -g wheel -G users ADMINUSER
passwd ADMINUSER
for other users,
useradd -m -g users -m USERNAME
passwd USERNAME


Syslog
Configure syslog,
cd /etc
mv syslog.conf syslog.conf.dist
cat > syslog.conf <<EOF9
*.* -/var/log/messages
EOF9
adjust the perms so administrators can read the logs,
cd /var/log
ls -l messages
chown root:wheel messages
ls -l messages

Also disable syslogd MARKs,
cd /etc/rc.d
vi rc.syslog
change (lines 9 and 10),
echo -n "/usr/sbin/syslogd -m0 "
/usr/sbin/syslogd -m0

Apply,
/etc/rc.d/rc.syslog restart


Time & date
Either use 'timezone' or proceed manually,
echo UTC > /etc/hardwareclock
cd /etc
rm -f localtime*
ln -sf /usr/share/zoneinfo/Europe/Paris localtime

Enable NTP,
cd /etc
mv ntp.conf ntp.conf.dist
sed '/^#/d; /^$/d;' ntp.conf.dist > ntp.conf.dist.clean
cat > ntp.conf <<EOF9
server ntp.obspm.fr
driftfile /etc/ntp/drift
EOF9
note. drift file location on slackware
apply,
chmod +x /etc/rc.d/rc.ntpd
/etc/rc.d/rc.ntpd restart


Misc
Generate the index,
updatedb

Configure SSH,
cd /etc/ssh
mv sshd_config sshd_config.dist
port=YOUR_SSHPORT
group=YOUR_SSHGROUP
cat > sshd_config <<EOF9
Port $port
Protocol 2
AllowGroups $sshgroup
X11Forwarding yes
Subsystem sftp /usr/libexec/sftp-server
EOF9
unset port group
apply,
/etc/rc.d/rc.sshd restart

For server use, you may safely disable those daemons,
cd /etc/rc.d
ls -l
chmod -x rc.pcmcia rc.alsa rc.acpid rc.hald rc.inetd
Note. (unless you need inetd)


Custom wrappers
You'll want to install additional packages and/or sets. Here's are some handy scripts for that,
mkdir -p ~/bin
cd ~/bin
wget pbraun.nethence.com/code/sysutils_slackware/checkpkg.ksh
wget pbraun.nethence.com/code/sysutils_slackware/installpkg.ksh
wget pbraun.nethence.com/code/sysutils_slackware/installset.ksh
chmod +x checkpkg.ksh
chmod +x installpkg.ksh
chmod +x installset.ksh
Note. we're not using slackpkg as it matches patterns. If you say e.g.,
#slackpkg install gcc
you'll be eventually end up with the whole gcc suite, we don't want that.
Note. to find the package corresponding to a missing file or library, either grep on FILE_LIST or use search.slackware.eu/
Note. to see if a package is already install (the mentioned scripts do that anyway),
ls -ltr /var/log/packages | grep -i ...


References
slackware.com/
slackfr.org/doku.php


Home | UNIX | Oracle | Code | Practical | Private | Donate | Print | html/css
© 2010 Pierre-Philipp Braun