This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script to harden ssh on ubuntu/debian server | |
# follow on my blog http://www.coderew.com/hardening_ssh_on_remote_ubuntu_debian_server/ | |
# checkout the repo for more scripts https://github.com/nvnmo/handy-scripts | |
read -p "Enter your server IP:" serverIP # prompt for server IP | |
read -p "Enter your username(requires root privileges):" username # prompt for username | |
printf "\nChanging the default SSH port is one of the easiest\n things you can do to help harden you servers security. \nIt will protect you from robots that are programmed \nto scan for port 22 openings, and commence \ntheir attack." | |
printf "\n" | |
read -p "Do you want to change default SSH port?[Y/n]" -n 1 portChange |