Script to run on fresh Ubuntu installation to do the following:
- Update the system with the latest patches
- Install Open-SSH Server
- Enable UFW and allow OpenSSH
- Disable root SSH login
- Setup an SSH login message that shows current system status
- Setup automatic security updates for unattended installation
- Install and configure Fail2Ban (maxretry 4)
- Install Speedtest CLI tool
- Setup SFTP server that runs over SSH
- Option to install Docker with Portainer
- Option to install WireGuard VPN Server
If you created a non-root user as part of the setup, you can move on. If not, first create a non-root user and add them to the sudo group like this. Be sure to replace "newusername" with the actual user name that you wish to create.
- From the root termianl issue the following command: adduser newusername
- Fill out the information, the password is the only important part.
- Next add the new user to the sudo group using this command: usermod -aG sudo newusername
- Now you can switch to the new user by issuing this command: su newusername
- Finally, if you issue this command, you will go to your new home directory: cd ~/
To use this script, after installing a fresh Ubuntu Server, run this command as a non-root user: wget https://raw.githubusercontent.com/Charlie67j/rafui/master/ubuntu_fresh_install.sh && chmod 755 ubuntu_fresh_install.sh && ./ubuntu_fresh_install.sh