/serverharden

Minimal hardening for proxy server

Primary LanguageShell

Server Hardening

Minimal hardening for proxy server

How to run

  1. clone this repo

    git clone https://github.com/mehrdad-drpc/serverharden.git
  2. change you location inside the project directory

    cd serverharden
  3. run this command and enter the inputs

    sudo bash hardening.sh

one-command-run

you can also do the above steps with one command

git clone https://github.com/mehrdad-drpc/serverharden.git && cd serverharden && sudo bash hardening.sh

The script is waiting for you to copy your public ssh key to your new user's home directory that was created recently.

Note: UFW will be enabled after the script is run, and the ssh port will be changed to 8452, also you can't login into ssh through password due to new ssh config.


Follow the below command to copy your public key

$ ssh-copy-id -p <default_port_number> -i /path/to/<your_public_key> <new_user>@<server_address>

Test your connection

$ ssh <your_server_ip_address> -p 8452 -l <new_user>

Install internal and external services

install necessary services in internal and external servers

Run the following file install_services.sh and enter the inputs

sudo bash install_services.sh