Skip to main content

Basic Server Setup

Standard procedure for setting up a new Debian/Ubuntu server in this environment.

1. Initial Update

Always start by updating the package lists and upgrading existing packages.

sudo apt update
sudo apt upgrade -y

2. Install Common Tools

Install utilities frequently used for maintenance and monitoring.

sudo apt install -y curl wget git tmux btop iftop net-tools unzip

3. Secure SSH Access

Security best practice: Disable password authentication and root login.

  1. Create .ssh directory (if not exists):

    mkdir -p ~/.ssh
    chmod 700 ~/.ssh
  2. Add Authorized Key: Paste your public key into ~/.ssh/authorized_keys.

    nano ~/.ssh/authorized_keys
    chmod 600 ~/.ssh/authorized_keys
  3. Configure SSH Daemon: Edit /etc/ssh/sshd_config:

    sudo nano /etc/ssh/sshd_config

    Ensure these settings are set:

    PermitRootLogin no
    PasswordAuthentication no
    PubkeyAuthentication yes
  4. Restart SSH:

    sudo systemctl restart sshd

4. Set Hostname

sudo hostnamectl set-hostname <new-hostname>