223 words
1 minute
Debian 自用初始化

初始化安装#

VPS 重装 Debian11#

bash <(wget --no-check-certificate -qO- 'https://www.moeelf.com/attachment/LinuxShell/InstallNET.sh') -d 11 -v 64 -a

Oracle vps SSH登录初始化脚本#

#!/bin/bash
echo root:password123789 |sudo chpasswd root
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config;
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config;
sudo service sshd restart

Debian11 换源#

cat > /etc/apt/sources.list << EOF
deb http://deb.debian.org/debian/ bullseye main non-free contrib
deb http://deb.debian.org/debian/ bullseye-updates main non-free contrib
deb-src http://deb.debian.org/debian/ bullseye main non-free contrib
deb-src http://deb.debian.org/debian/ bullseye-updates main non-free contrib
deb http://deb.debian.org/debian/ bullseye-backports main contrib non-free
deb-src http://deb.debian.org/debian/ bullseye-backports main contrib non-free
deb http://deb.debian.org/debian-security/ bullseye-security main contrib non-free
deb-src http://deb.debian.org/debian-security/ bullseye-security main contrib non-free
EOF
apt-get update
apt-get upgrade

操作自定义管理#

配置初始 sshd 服务#

vim /etc/ssh/sshd_config
systemctl restart sshd

常用包安装#

apt-get update
apt-get install sudo -y
apt-get install vim -y
apt-get install curl -y
apt-get install wget -y
apt-get install ufw -y
apt-get install zip -y
apt-get install screen -y

特殊用途常用安装#

apt-get update
apt-get install git -y
apt-get install python3 -y
apt-get install pip -y

UFW 防火墙#

ufw allow 8080
ufw allow 443
ufw allow 22
ufw enable

Swap 设置#

wget -q https://raw.githubusercontent.com/Dreamscape315/Swap_Manager/main/Swap_Manager.sh && chmod +x Swap_Manager.sh && sudo ./Swap_Manager.sh

Docker 相关#

apt-get install docker-ce docker-ce-cli containerd.io -y
docker system prune -a --volumes
Debian 自用初始化
https://fuwari.vercel.app/posts/oraclecmd/
Author
Akatsuki Sky
Published at
2023-09-04
License
CC BY-NC-SA 4.0