"Top things you need to do after installing Ubuntu Server!" - All in one script! - MUST HAVE!
This bash script is designed to automate the process of setting up and securing a fresh Ubuntu-based server system. It performs a series of tasks including updating the system, installing essential packages, configuring Git, setting up SSH with enhanced security measures, configuring the UFW firewall and fail2ban for improved system protection, creating useful bash aliases, and performing system cleanup.
Quick Method
bash <(curl -s https://raw.githubusercontent.com/AYJAYY/fresh-install-ubuntu/main/fiu.sh)
1
Alternative Method
wget https://raw.githubusercontent.com/AYJAYY/fresh-install-ubuntu/main/fiu.sh
chmod +x ./fiu.sh
- Run as non-root user
./fiu.sh
- Verifies the script is not run as root
- Verifies the OS is Ubuntu-based
- Performs system updates (apt-get update, upgrade, dist-upgrade, snap refresh)
- Installs a variety of useful software packages
- btop,build-essential,bwm-ng,cockpit,curl,ecryptfs-utils,fail2ban,flatpak,gettext,git-all,googler,gparted,htop,iftop,iotop,libcurl4-gnutls-dev,libexpat1-dev,libssl-dev,libz-dev,net-tools,nmap,openssh-client,openssh-server,p7zip-full,p7zip-rar,python3,python3-pip,samba,snap,speedtest-cli,ssh,sysstat,thefuck,unattended-upgrades,unrar,vnstat,yt-dlp
- Adds and installs additional repositories (fastfetch)
- Prompts for GitHub username and email
- Configures git globally if information is provided
- Modifies SSH configuration for improved security
- Disables forwarding, root login, and ignores rhosts
- Enables and configures UFW (Uncomplicated Firewall)
- Opens specific ports (HTTP, Samba, SSH, 9090, 8112)
- Installs and configures fail2ban for SSH protection
-
Creates numerous aliases for common tasks, including:
- System management (updates, cleaning)
- File operations
- Git commands
- YouTube downloading
-
Stores these aliases in a file in the same directory as the script
-
Adds fastfetch to bash startup
- Performs system cleanup operations (autoclean, clean)
- Enforces non-root user usage
- Secures SSH configuration (Also Disables Password Login)
- Enables and configures firewall
- Implements fail2ban for brute-force protection
- Adds various quality-of-life aliases
- Improves terminal startup with fastfetch
Inspired By: The thousands of blog posts that come around each release cycle of Ubuntu on things to do on a fresh install. Examples: Tutorials Point Article | Steemit Article
Based on the legendary - First Ten Seconds by TedLeRoy, which was inspired by Jerry Gamblin's post: My First Ten Seconds on a Server by Jerry Gamblin
Footnotes
-
Given that many individuals hesitate to curl content straight into bash, we advise utilizing the alternative method and inspecting the source code to validate the commands being executed. ↩