Post

Debian 12 Setup Guide

My Debian 12 Desktop Setup and Security Guide

Introduction

In this blog post, I will walk you through the steps I took to set up my Debian 12 Desktop with a focus on security and essential configurations. I’ve also included resources that helped me along the way, and I’ll give credit to those who deserve it. Let’s get started!

Credits

Before we dive into the setup, I want to acknowledge the following resources that greatly contributed to my knowledge and inspired this guide:

  1. Learn Linux TV (Debian 12 - The First 12 Things You Should Do After Installation!) - Watch here
  2. NetworkChuck (5 Steps to Secure Linux (protect from hackers)) - Watch here
  3. Chris Titus Tech (The Biggest Linux Security Mistakes) - Watch here
  4. ChatGPT - Access here

Now, let’s explore the steps I took to set up my Debian 12 Desktop.

Step 1: Adding a User with Sudo Privileges

The first thing you should do after a fresh Debian installation is to add a user with sudo privileges. Use the following command:

1
sudo usermod -aG sudo username

If you have setup Debian 12 you probably have a username apart from root. Replace username with your username. You will need to login as root to do this using the following command.

1
su -

Step 2: Disabling the Root Password

To enhance security, it’s recommended to disable the root password. This can be done using the following command:

1
passwd -l root

You will need to login as root to do the above using:

1
su -

Step 3: Enabling the Root Password (If needed)

To enable the root password, use:

1
sudo passwd root

Step 4: Installing Flatpak and Gnome Software Plugin

Flatpak is a package manager that allows you to easily install and run applications. You can install Flatpak and the Gnome Software Plugin using the following commands:

1
2
sudo apt install flatpak gnome-software-plugin-flatpak
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Step 5: Installing Browsers

Remove the default Firefox browser and install the latest version of Firefox through Gnome Software using the Flatpak version.

1
sudo apt remove firefox-esr

Install Firefox through Gnome Software

Download Chrome via Firefox

You can install Chrome as follows with all dependencies:

1
sudo apt install ./google-chrome-filename.deb

Replace “google-chrome-filename.deb” with the actual file name.

You will need to be in the Downloads folder to do this.

Step 6: Multimedia Codecs and VLC

To ensure you can enjoy multimedia content, install the necessary codecs and VLC media player:

1
sudo apt install libavcodec-extra vlc

Step 7: Adding the “Backports” Repository

To access newer software packages, you can add the “Backports” repository. Create a file for it and add the repository with the following commands:

1
sudo nano /etc/apt/sources.list.d/backports.list

Add the following line to the file.

1
deb http://deb.debian.org/debian bookworm-backports main

Step 8: Installing Uncomplicated Firewall (UFW)

For enhanced security, set up the Uncomplicated Firewall (UFW) and configure some basic rules to limit access:

1
sudo apt install ufw

Recommended UFW Rules

1
2
3
4
5
6
sudo ufw limit 22/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw enable

Step 9: Installing ClamAV and ClamTK

To keep your system free from malware, install ClamAV and its graphical front-end, ClamTK:

1
sudo apt install clamav clamtk

Step 10: Customize GRUB Timeout

To tailor the boot menu timeout in Debian 12, follow these three commands:

Open a terminal and enter this command:

1
sudo nano /etc/default/grub

Modify the “GRUB_TIMEOUT” value to your desired seconds, e.g. 20 seconds:

1
GRUB_TIMEOUT=20

Save the file, update GRUB configuration:

1
sudo update-grub

Reboot your system, and the adjusted timeout will be reflected in the GRUB menu.

Conclusion

With these steps, you’ve set up your Debian 12 Desktop with improved security and essential configurations. This guide is intended to help you and others looking to setup and secure their Debian environment. Feel free to refer back to this blog post as needed, and don’t forget to explore the credited resources for more in-depth knowledge.

If you have any questions or further suggestions, please leave a comment below. Happy Linux-ing!

This post is licensed under CC BY 4.0 by the author.