Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jasonheecs/ubuntu-server-setup
A setup script for Ubuntu servers
https://github.com/jasonheecs/ubuntu-server-setup
automate bash script shell-script ubuntu ubuntu-server
Last synced: 11 days ago
JSON representation
A setup script for Ubuntu servers
- Host: GitHub
- URL: https://github.com/jasonheecs/ubuntu-server-setup
- Owner: jasonheecs
- License: mit
- Created: 2016-11-27T18:08:55.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-02-04T19:38:12.000Z (9 months ago)
- Last Synced: 2024-08-02T11:25:31.689Z (3 months ago)
- Topics: automate, bash, script, shell-script, ubuntu, ubuntu-server
- Language: Shell
- Homepage:
- Size: 60.5 KB
- Stars: 554
- Watchers: 25
- Forks: 247
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bash setup script for Ubuntu servers
[![Build Status](https://travis-ci.org/jasonheecs/ubuntu-server-setup.svg?branch=master)](https://travis-ci.org/jasonheecs/ubuntu-server-setup)This is a setup script to automate the setup and provisioning of Ubuntu servers. It does the following:
* Adds or updates a user account with sudo access
* Adds a public ssh key for the new user account
* Disables password authentication to the server
* Deny root login to the server
* Setup Uncomplicated Firewall
* Create Swap file based on machine's installed memory
* Setup the timezone for the server (Default to "Asia/Singapore")
* Install Network Time Protocol# Installation
SSH into your server and install git if it is not installed:
```bash
sudo apt-get update
sudo apt-get install git
```Clone this repository into your home directory:
```bash
cd ~
git clone https://github.com/jasonheecs/ubuntu-server-setup.git
```Run the setup script
```bash
cd ubuntu-server-setup
bash setup.sh
```# Setup prompts
When the setup script is run, you will be prompted to enter the username of the new user account.Following that, you will then be prompted to add a public ssh key (which should be from your local machine) for the new account. To generate an ssh key from your local machine:
```bash
ssh-keygen -t ed25519 -a 200 -C "user@server" -f ~/.ssh/user_server_ed25519
cat ~/.ssh/user_server_ed25519.pub
```Finally, you will be prompted to specify a [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for the server. It will be set to 'Asia/Singapore' if you do not specify a value.
# Supported versions
This setup script has been tested against Ubuntu 14.04, Ubuntu 16.04, Ubuntu 18.04, Ubuntu 20.04 and Ubuntu 22.04.# Running tests
Tests are run against a set of Vagrant VMs. To run the tests, run the following in the project's directory:
`./tests/tests.sh`