#CREATING YOUR OPENSSH KEY IF YOU DON'T ALREADY HAVE IT ON YOUR LOCAL MACHINEssh-keygen-ted25519-C"name"#THEN COPY PUBLIC SSH KEY TO YOUR SERVERssh-copy-id-i~/.ssh/name_id_ed25519.pubUsername@000.000.000
Update System and Installation of Basic Validator Package
# Login to the server as "root user" and add a new admin useradduser"new_user"# Add your new user to sudo groupusermod-aGsudo"new_user"# Then swicth from your root to the new User you createdsu"new_user"cd#to go back to home directory# upgrade system packagessudoapt-getupdate&&sudoaptupgrade-ysudoaptinstallmctmuxcurlwgetsmartmontools# disable root login, disable password authentication, use ssh keys onlysudosed-i's|^PermitRootLogin .*|PermitRootLogin no|'/etc/ssh/sshd_configsudosed-i's|^ChallengeResponseAuthentication .*|ChallengeResponseAuthentication no|'/etc/ssh/sshd_configsudosed-i's|^#PasswordAuthentication .*|PasswordAuthentication no|'/etc/ssh/sshd_configsudosed-i's|^#PermitEmptyPasswords .*|PermitEmptyPasswords no|'/etc/ssh/sshd_configsudosed-i's|^#PubkeyAuthentication .*|PubkeyAuthentication yes|'/etc/ssh/sshd_configsudosystemctlrestartsshd# install and configure firewallsudoaptinstall-yufwsudoufwdefaultallowoutgoingsudoufwdefaultdenyincomingsudoufwallow"new_ssh_port"sudoufwallow9100sudoufwallow26656sudoufwallow26657# make sure you expose ALL necessary ports, only after that enable firewallsudoufwenable# install fail2bansudoaptinstall-yfail2ban# now you can logout (exit) and login again using ssh "new_username"@IP_ADDRESS