https://github.com/anduin2017/init-server
https://github.com/anduin2017/init-server
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/anduin2017/init-server
- Owner: Anduin2017
- License: gpl-3.0
- Created: 2025-05-28T17:09:53.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-06-24T04:06:03.000Z (12 months ago)
- Last Synced: 2025-06-24T05:23:53.278Z (12 months ago)
- Language: Shell
- Size: 28.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Init Server
This is a script to initialize a new Ubuntu server with the following features:
* Create your own user with sudo privileges
* Change hostname
* Only allow SSH key login
* Root login disabled, password authentication disabled
* Have a random password stored securely at /etc/.pass
* Have SSH key copied to authorized_keys so you can log in without a password
* Be hardened with UFW, Fail2Ban and allowed SSH connections(only)
* Have BBR enabled for better network performance
* Have the latest HWE kernel installed
* Have the best mirror selected for package updates
* Have snap removed
* Have CPU performance tuned to 'performance' mode
* Have timezone set to GMT
* Have all unnecessary users removed (Check /etc/passwd for remaining users)
* Have all unnecessary packages removed
* Have the latest updates installed
* Have sysbench installed for performance testing
* Have a final benchmark run to verify CPU performance
* Have a final cleanup of unnecessary packages
## How to use
Fisrt, buy a new Ubuntu server from your favorite provider.
Usually they will give you a root user with a password and SSH key access.
Run the following commands on your **local machine**!
```bash
init_link="https://gitlab.aiursoft.cn/anduin/init-server/-/raw/master/init.sh?ref_type=heads"
wget $init_link -O init.sh
chmod +x init.sh
```
Then run **on your Local Machine**:
```bash
./init.sh
```
For example:
```bash
./init.sh root "old_password@" 1.2.3.4 my-new-hostname my-new-user
```
If you prefer use SSH to login, simply provide an empty password:
```bash
./init.sh user "" 1.2.3.4 my-new-hostname user
```