Wednesday, November 27, 2019

Server hardening

If you want to prevent your server from attack, you should disable root ssh login. for this you should proceed to /etc/ssh and open sshd_config with your favorite editor and change permit root login to no.
done. you can even change your default ssh port to prevent attack. edit /etc/ssh/sshd_config with your favorite editor. uncomment #Port 22 and change 22 to another port. its important to open that port on firewall. after that restart your sshd service by systemctl restart sshd command.




************just be careful, if selinux is set to enforcing, you can't ssh to your server with any users except root.

No comments:

Post a Comment