This repository has been archived on 2026-08-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
2026-08-20 00:45:43 +02:00

21 lines
369 B
Bash

#!/bin/bash
# Set SSH limits high
set -e
CONF="/etc/ssh/sshd_config"
# Remove old lines
sed -i '/^#*MaxStartups/d' "$CONF"
sed -i '/^#*MaxSessions/d' "$CONF"
# Add new limits
echo "MaxStartups 200:30:500" >> "$CONF"
echo "MaxSessions 200" >> "$CONF"
# Restart sshd
systemctl restart sshd
# Verify
grep -E 'MaxStartups|MaxSessions' "$CONF"
echo "SSH limits set OK"