Skip to content

Instantly share code, notes, and snippets.

@stesee
Last active July 29, 2025 21:16
Show Gist options
  • Save stesee/e5b7735cff703e6aac35271d9cbd12ab to your computer and use it in GitHub Desktop.
Save stesee/e5b7735cff703e6aac35271d9cbd12ab to your computer and use it in GitHub Desktop.
#!/bin/bash
# ubuntuMinimalSetup.sh - Minimal setup for Ubuntu 24.04
#
# Usage note:
# To download and run this script in one command, use:
# bash <(curl -fsSL https://gist.githubusercontent.com/stesee/e5b7735cff703e6aac35271d9cbd12ab/raw/2b024b8f53a1302d62211241d72a5061696f9fc8/ubuntuMinimalSetup.sh)
#
# This script will:
# - Install git
# - Install and enable OpenSSH server
set -e
echo "Enable passwordless sudo (helps run things in github actions)..."
echo "$(whoami) ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/$(whoami)
sudo chmod 0440 /etc/sudoers.d/$(whoami)
echo "Updating package lists..."
sudo apt update
echo "Installing git..."
sudo apt install -y git
echo "Installing OpenSSH server..."
sudo apt install -y openssh-server
echo "Enabling and starting SSH service..."
sudo systemctl enable ssh
sudo systemctl start ssh
echo "SSH service status:"
sudo systemctl status ssh --no-pager
echo "Git and SSH setup complete."
hostname -I
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment