ThisIsJo(e).com

Hello, this is my blog, where I document my thoughts and opinions. My current professional passions are cybersecurity, Linux, and networking.

Start You’r Home Server with A old computer


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

  1. A USB Drive: At least 4 GB of storage (8 GB recommended).
  2. An Old Computer or Laptop: Ensure it has at least 2 GB of RAM and sufficient storage.
  3. Debian ISO File: Download from the Debian website.
  4. Bootable USB Creation Tool: Rufus (Windows), Balena Etcher (macOS), or dd (Linux).

Step 1: Create a Bootable USB Drive

For Windows
  1. Download Rufus: Visit Rufus and download the latest version.
  2. Insert the USB Drive: Connect it to your computer.
  3. Open Rufus: Select your USB drive from the Device dropdown.
  4. Select the Debian ISO: Click SELECT, choose the Debian ISO file.
  5. Configure Settings:
  • Partition Scheme: Choose GPT for UEFI or MBR for BIOS.
  • File System: Select FAT32.
  1. Start the Process: Click START, confirm warnings, and wait for completion.
For macOS
  1. Download Balena Etcher: Get it from Balena Etcher’s official site.
  2. Insert the USB Drive: Connect it to your Mac.
  3. Open Etcher: Launch the application.
  4. Select the Debian ISO: Click Flash from file, then choose the Debian ISO.
  5. Choose the USB Drive: Click Select target, pick your USB drive.
  6. Create Bootable USB: Click Flash! and wait for the process to finish.
For Linux
  1. Identify the USB Drive: Use lsblk to find your USB drive (e.g., /dev/sdX).
  2. Unmount the Drive: Unmount if necessary:
   sudo umount /dev/sdX1
  1. Write the ISO to the USB: Use dd:
   sudo dd if=/path/to/debian.iso of=/dev/sdX bs=4M status=progress
  1. Wait for Completion: The process will take a few minutes.

Step 2: Install Debian

  1. 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.
  2. 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.
  1. Complete Installation: Reboot into your new Debian system.

Step 3: Create a Superuser and Add to the wheel Group

  1. Open a Terminal: Log in to your Debian system.
  2. Create a New User:
   sudo adduser newusername

Replace newusername with your desired username. Follow the prompts to set a password and other details.

  1. Add the User to the wheel Group:
  • Edit the sudoers File: Add the wheel group to the sudoers file by running:
    bash sudo visudo
  • Add the Following Line:
    bash %wheel ALL=(ALL) ALL
    This line allows users in the wheel group to use sudo.
  • 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
  1. Verify User Group:
    Confirm the user is added to the wheel group:
   groups newusername

Step 4: Install and Configure SSH with SHA-256 Fingerprints

  1. Install OpenSSH Server:
   sudo apt update
   sudo apt install openssh-server
  1. Check SSH Service Status:
   sudo systemctl status ssh

Ensure it’s running. Start it with:

   sudo systemctl start ssh
  1. Edit SSH Configuration:
    Open the SSH configuration file:
   sudo nano /etc/ssh/sshd_config
  1. 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.

  1. Restart SSH Service:
   sudo systemctl restart ssh
  1. 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

Your email address will not be published. Required fields are marked *