For linux common commands, see 开发技巧收藏
-
Update Source
apt update --yes && apt upgrade --yes
-
Install sudo package
apt install -y sudo
-
Open BBR: Open BBR for Debian
-
Use ssh key login instead of password, for more details see How To Configure SSH Key-Based Authentication on a Linux Server
-
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
-
Change the default password
passwd
-
Create an admin group
groupadd admin
- Give admin group root access, and no password sudo
- Backup sudo files
cp /etc/sudoers /root/sudoers.bak
- Edit the
/etc/sudoers
file by typing the command:visudo
- Add
%admin ALL=(ALL:ALL) NOPASSWD:ALL
aftersudo
group
- Backup sudo files
-
Create a admin group user
useradd username -g admin
-
Use ssh key login instead of password for normal user
ssh-copy-id -i ~/.ssh/id_rsa.pub username@remote_host
-
Login with new normal user
ssh username@ip
-
Install common utils:
sudo apt install build-essential software-properties-common curl vim unzip git pkg-config libssl-dev --yes
-
Create
/data
for store data files with777
permissions, avoid to use/home
directory
You might want to read also: