bootstrap.sh aktualisiert
This commit is contained in:
parent
5a7c0b21fa
commit
0ee9c0ea07
1 changed files with 4 additions and 13 deletions
17
bootstrap.sh
17
bootstrap.sh
|
@ -8,13 +8,12 @@ if [ "$(id -u)" -ne 0 ]; then
|
|||
fi
|
||||
|
||||
USERNAME="skulladmin"
|
||||
SSH_KEY_URL="https://skulldev.de/kevinheyer/trusted-ssh-keys/raw/branch/main/trusted_ssh_keys"
|
||||
SSH_KEY_URL="https://skulldev.de/Skull-IT/trusted-ssh-keys/raw/branch/main/trusted-ssh-keys"
|
||||
SSH_DIR="/home/$USERNAME/.ssh"
|
||||
|
||||
echo "[+] Creating user '$USERNAME' if it doesn't exist..."
|
||||
if ! id "$USERNAME" &>/dev/null; then
|
||||
useradd -m -s /bin/bash "$USERNAME"
|
||||
fi
|
||||
echo "[+] Updating package list and installing essential packages..."
|
||||
apt-get update -y
|
||||
apt-get install -y sudo curl wget gnupg lsb-release software-properties-common
|
||||
|
||||
echo "[+] Setting up SSH directory..."
|
||||
mkdir -p "$SSH_DIR"
|
||||
|
@ -31,10 +30,6 @@ mkdir -p /etc/sudoers.d
|
|||
echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" > "/etc/sudoers.d/$USERNAME"
|
||||
chmod 440 "/etc/sudoers.d/$USERNAME"
|
||||
|
||||
echo "[+] Disabling SSH root login..."
|
||||
sed -i 's/^#*PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config
|
||||
systemctl restart sshd
|
||||
|
||||
echo "[+] Setting timezone to Europe/Berlin..."
|
||||
timedatectl set-timezone Europe/Berlin
|
||||
|
||||
|
@ -43,8 +38,4 @@ while fuser /var/lib/dpkg/lock-frontend >/dev/null 2>&1; do
|
|||
sleep 3
|
||||
done
|
||||
|
||||
echo "[+] Updating package list and installing essential packages..."
|
||||
apt-get update -y
|
||||
apt-get install -y sudo curl wget gnupg lsb-release software-properties-common
|
||||
|
||||
echo "[✓] Bootstrap complete."
|
Loading…
Add table
Reference in a new issue