Enables one to run setup without creating a new user by using a second non-root account (#15)

* Enable one to choose to use an existing second non-root account for configuring the server.

* Current user by def

* Changed default TimeZone and added a more secure ssh key derivation
method according to https://blog.peterruppel.de/ed25519-for-ssh/

* Refactor setup scripts

Co-authored-by: BreakSecurity <[email protected]>
This commit is contained in:
Jason HeeandBreakSecurity authored and GitHub committed 2022-04-18 04:49:00 +08:00
1 parent 8c4f801e10
commit 7beaeed0cd
3 files changed
+29 -8

No files matched your search

+4 -4
View File
@@ -2,7 +2,7 @@
[![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 a new user account with sudo access
* 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
@@ -35,8 +35,8 @@ When the setup script is run, you will be prompted to enter the username of the
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 rsa
cat ~/.ssh/id_rsa.pub
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.
@@ -46,4 +46,4 @@ This setup script has been tested against Ubuntu 14.04, Ubuntu 16.04, Ubuntu 18.
# 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`
`./tests/tests.sh`