Setting Up Your Debian Home Server: A Step-by-Step Guide
Hello, were going to use a old HP micro PC for a home server. This guide will walk you through the entire process: from preparing your hardware to installing Debian, creating a superuser account, configuring SSH to use SHA-256 for fingerprints, and ensuring secure access.
What You’ll Need
- A USB Drive: At least 4 GB of storage (8 GB recommended).
- An Old Computer or Laptop: Ensure it has at least 2 GB of RAM and sufficient storage.
- Debian ISO File: Download from the Debian website.
- Bootable USB Creation Tool: Rufus (Windows), Balena Etcher (macOS), or
dd
(Linux).
Step 1: Create a Bootable USB Drive
For Windows
- Download Rufus: Visit Rufus and download the latest version.
- Insert the USB Drive: Connect it to your computer.
- Open Rufus: Select your USB drive from the
Device
dropdown. - Select the Debian ISO: Click
SELECT
, choose the Debian ISO file. - Configure Settings:
- Partition Scheme: Choose
GPT
for UEFI orMBR
for BIOS. - File System: Select
FAT32
.
- Start the Process: Click
START
, confirm warnings, and wait for completion.
For macOS
- Download Balena Etcher: Get it from Balena Etcher’s official site.
- Insert the USB Drive: Connect it to your Mac.
- Open Etcher: Launch the application.
- Select the Debian ISO: Click
Flash from file
, then choose the Debian ISO. - Choose the USB Drive: Click
Select target
, pick your USB drive. - Create Bootable USB: Click
Flash!
and wait for the process to finish.
For Linux
- Identify the USB Drive: Use
lsblk
to find your USB drive (e.g.,/dev/sdX
). - Unmount the Drive: Unmount if necessary:
sudo umount /dev/sdX1
- Write the ISO to the USB: Use
dd
:
sudo dd if=/path/to/debian.iso of=/dev/sdX bs=4M status=progress
- Wait for Completion: The process will take a few minutes.
Step 2: Install Debian
- Boot from the USB Drive: Insert the USB drive into your computer, enter BIOS/UEFI, and set the USB drive as the primary boot device.
- Run the Debian Installer: Follow the prompts:
- Language Selection: Choose your preferred language.
- Network Configuration: Set up your network.
- Partition Disks: Use guided partitioning.
- User Accounts: Create a root password and a regular user account.
- Software Selection: Install additional software as needed.
- Complete Installation: Reboot into your new Debian system.
Step 3: Create a Superuser and Add to the wheel
Group
- Open a Terminal: Log in to your Debian system.
- Create a New User:
sudo adduser newusername
Replace newusername
with your desired username. Follow the prompts to set a password and other details.
- Add the User to the
wheel
Group:
- Edit the sudoers File: Add the
wheel
group to thesudoers
file by running:bash sudo visudo
- Add the Following Line:
bash %wheel ALL=(ALL) ALL
This line allows users in thewheel
group to usesudo
. - Create the
wheel
Group (if it doesn’t exist):bash sudo groupadd wheel
- Add the User to the
wheel
Group:bash sudo usermod -aG wheel newusername
- Verify User Group:
Confirm the user is added to thewheel
group:
groups newusername
Step 4: Install and Configure SSH with SHA-256 Fingerprints
- Install OpenSSH Server:
sudo apt update
sudo apt install openssh-server
- Check SSH Service Status:
sudo systemctl status ssh
Ensure it’s running. Start it with:
sudo systemctl start ssh
- Edit SSH Configuration:
Open the SSH configuration file:
sudo nano /etc/ssh/sshd_config
- Configure Fingerprint Hashing:
Ensure the following line is present:
HostKeyAlgorithms ssh-rsa,ssh-ed25519
This setting ensures SHA-256 is used for host key fingerprints.
- Restart SSH Service:
sudo systemctl restart ssh
- Verify Fingerprint Hashing:
Check the SSH key fingerprints:
ssh-keygen -lf /etc/ssh/ssh_host_rsa_key.pub
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub
You should see SHA-256 fingerprints.
Conclusion
Your Debian home server is now set up with a secure SSH configuration using SHA-256 for fingerprint hashing. You’ve also created a superuser account in the wheel
group, providing elevated privileges for system management. Enjoy the capabilities of your new server, whether it’s for hosting services, managing files, or any other tasks you have in mind!
Feel free to ask if you need further assistance or have additional questions!
Leave a Reply