Slackware HowTo

Configure SSHD on Slackware with keys (base)

OpenSSH with public keys and a safe service restart.

Always open a second SSH session before changing sshd_config.

1. Enable the service

chmod +x /etc/rc.d/rc.sshd
/etc/rc.d/rc.sshd start

2. Keys and authorized_keys

mkdir -p ~/.ssh
chmod 700 ~/.ssh
cat key.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys

3. Basic sshd_config options

PermitRootLogin no
PubkeyAuthentication yes
PasswordAuthentication no
AllowUsers adminuser

4. Test and restart

sshd -t
/etc/rc.d/rc.sshd restart
If sshd -t is clean, the restart is safe. Test login in a new session before closing the current one.

5. Checks

ss -tulpen | grep ':22'
grep sshd /var/log/messages | tail -n 30

Quick checklist

[ ] rc.sshd enabled
[ ] keys installed
[ ] sshd_config tested with sshd -t
[ ] rc.sshd restarted
[ ] key login verified

Back to the Linux HowTo section