From b49ec00375e972c542fdf74dd6c59244448e8070 Mon Sep 17 00:00:00 2001 From: micutu Date: Mon, 14 Oct 2024 22:08:41 +0000 Subject: [PATCH] Add init-letsencrypt.sh --- init-letsencrypt.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 init-letsencrypt.sh diff --git a/init-letsencrypt.sh b/init-letsencrypt.sh new file mode 100644 index 0000000..0758742 --- /dev/null +++ b/init-letsencrypt.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# Goal: Script which automatically sets up a new Ubuntu Machine after installation +# This is a basic install, easily configurable to your needs + +# Test to see if user is running with root privileges. +if [[ "${UID}" -ne 0 ]] +then + echo 'Must execute with sudo or root' >&2 + exit 1 +fi + +# Ensure system is up to date +echo '///---Start update the apt-get lib ---///' +sudo apt-get update -y +echo '///---End update the apt-get lib ---///' + +# Upgrade the system +echo '///---Start update system ---///' +sudo apt-get upgrade -y +echo '///---End update system ---///' + +# Install OpenSSH +echo '///---Start install OPenssh ---///' +sudo apt-get install openssh-server -y +echo '///---End install OpenSSH ---///' + +# Enable Firewall +echo '///---Enable firewall start ---///' +sudo ufw --force enable +echo '///---Enable firewall End ---///' + +# configure the firewall +echo '///---Enable open SSH on firewall ---///' +sudo ufw allow OpenSSH +echo '///---Done ---///' \ No newline at end of file