I am back with another published article.
Please be kind! I am a self-taught Linux user and by no means an expert. My goal with this guide is to help newcomers to Linux have an easier and more secure start.
To all the experts out there, please be kind and do share your tips and observations. I am happy to keep updating the article to make the self-hosting world more secure.
https://nerdyarticles.com/debian-server-essentials-setup-configure-and-hardening-your-system/
Nice work!
Some small pieces of feedback:
sudo
will be installed automaticallyAllowGroups
, rather than allowing individual users viaAllowUsers
. Note that once you disablePasswordAuthentication
, the only users that can SSH in are users that have keys inauthorized_keys
, so you don’t really need to useAllowUsers
orAllowGroups
.interesting, I’ll have to check out Crowdsec
Hi Daniel15. Is it recommended to disable the root user for a server during installation as you suggested? Are there never any tasks which must (or should) be executed as root for server setup or maintenance? I just built my first (Debian) server, so quite new to it all. Thanks.
You can do almost everything with sudo. Some thing are easier when done as the root user (such as setting cron jobs that need root permissions), but it should never be a necessity.
If you really do need root user, you can still enable root temporarily and disable it again.
Anything that you absolutely must do as root can be done using
sudo -i
which will give you a root shell.