-
clone this repo
git clone https://github.com/mehrdad-drpc/serverharden.git
-
change you location inside the project directory
cd serverharden
-
run this command and enter the inputs
sudo bash hardening.sh
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.
$ ssh-copy-id -p <default_port_number> -i /path/to/<your_public_key> <new_user>@<server_address>
$ ssh <your_server_ip_address> -p 8452 -l <new_user>
install necessary services in internal
and external
servers
Run the following file install_services.sh and enter the inputs
sudo bash install_services.sh