>> Home / Dev

Debian Server Setup

Published: , Updated: , Reading Time: 2 min

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:

📝 Edit this page🔗


Have you written a response to this? Let me know the URL, Or, you can send your response via mail owen@owenyoung.com