Home  >  All Categories  >  Dev  >  Debian Server Setup

Debian Server Setup

For linux common commands, see 开发技巧收藏

  1. Update Source

    apt update --yes && apt upgrade --yes
  2. Install sudo package

    apt install -y sudo
  3. Open BBR: Open BBR for Debian

  4. Use ssh key login instead of password, for more details see How To Configure SSH Key-Based Authentication on a Linux Server

  5. In your local machine:

ssh-copy-id -i ~/.ssh/id_rsa.pub username@remote_host

This will copy your id_rsa.pub to remote machine ~/.ssh/authorized_keys

  1. Change the default password

    1. passwd
  2. Create an admin group

    1. groupadd admin
    2. Give admin group root access, and no password sudo
      1. Backup sudo files cp /etc/sudoers /root/sudoers.bak
      2. Edit the /etc/sudoers file by typing the command: visudo
      3. Add %admin ALL=(ALL:ALL) NOPASSWD:ALL after sudo group
  3. Create a admin group user

    1. useradd username -g admin
  4. Use ssh key login instead of password for normal user

    1. ssh-copy-id -i ~/.ssh/id_rsa.pub username@remote_host
  5. Login with new normal user ssh username@ip

  6. Install common utils:

    1. sudo apt install build-essential software-properties-common curl vim unzip git pkg-config libssl-dev --yes
  7. Create /data for store data files with 777 permissions, avoid to use /home directory

You might want to read also:

Category: Dev 
Published:  · Updated:   📝 Edit this page

该博客没有评论系统,我正在实验有意义的讨论是否更易在社群中发生,不知道为什么,人在社群中,似乎会有更好的行为规范。然后如果有高质量的讨论,我会手动再精选到原文。为此,我建立了一个 Telegram 讨论群组,你可以在里面讨论这篇文章,点此复制文章标题和链接