Last active
November 8, 2021 19:39
-
-
Save wmcmurray/91aaffd9cf9f10f8a8dad7bd2fa89c70 to your computer and use it in GitHub Desktop.
Basic linode web server security configuration.
This file contains hidden or 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
# A default linode web server does not have a lot of configuration done, | |
# those are important basic steps to perform in order to secure the server | |
# and also configure it properly ! | |
# update dependencies | |
apt update | |
apt upgrade | |
# define hostname and timezone | |
hostnamectl set-hostname example-hostname | |
timedatectl set-timezone 'America/Montreal' | |
# disable ssh password login | |
(make sure the ssh keys I want to use are in /root/.ssh/authorized_keys !!) | |
nano /etc/ssh/sshd_config | |
(and set "PasswordAuthentication no") | |
systemctl restart sshd | |
# setup firewall | |
ufw allow ssh | |
ufw limit ssh | |
ufw allow 443 | |
ufw allow 80 | |
ufw show added | |
ufw enable | |
ufw status | |
# create a user for the project | |
adduser the-user-name-i-want | |
su - the-user-name-i-want | |
ssh-keygen -t rsa -b 4096 | |
----- bonus | |
# fix mysqld high memory usage | |
nano /etc/mysql/my.cnf | |
[mysqld] | |
performance_schema='0' | |
service mysql restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment