1 Install
source | url |
---|---|
163 | http://mirrors.163.com/.help/debian.html |
aliyun | https://developer.aliyun.com/mirror/debian |
ustc | https://mirrors.ustc.edu.cn/help/debian.html |
2 Config
sudo passwd root
# /etc/ssh/sshd_cofig
# PermitRootLogin yes
apt -y autoremove clean
Optimize-VHD -Path E:\_vhd\deb1.vhdx -Mode Full
# 更改主机名
# /etc/hostname
# /etc/hosts
# 查看硬盘
fdisk -l
# 创建新分区 n w
gdisk /dev/sdb
# 格式化新分区
mkfs.xfs /dev/sdb1
# 挂载 /etc/fstab
# 查看uuid
blkid
# UUID=6ee00141-8904-4734-8096-d95bf7ac645f /data ext4 defaults 0 0
3 Reference
# /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1
net.ipv6.conf.ens3.disable_ipv6=1
# /etc/network/interfaces
auto eth0
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet static
address 192.168.2.201
netmask 255.255.255.0
gateway 192.168.2.1
deb http://mirrors.ustc.edu.cn/debian/ bullseye main non-free contrib
deb-src http://mirrors.ustc.edu.cn/debian/ bullseye main non-free contrib
deb http://mirrors.ustc.edu.cn/debian-security/ bullseye-security main
deb-src http://mirrors.ustc.edu.cn/debian-security/ bullseye-security main
deb http://mirrors.ustc.edu.cn/debian/ bullseye-updates main non-free contrib
deb-src http://mirrors.ustc.edu.cn/debian/ bullseye-updates main non-free contrib
deb http://mirrors.ustc.edu.cn/debian/ bullseye-backports main non-free contrib
deb-src http://mirrors.ustc.edu.cn/debian/ bullseye-backports main non-free contrib
# sudo bash <(wget -q -O - https://linianhui.github.io/linux/debian/init.sh)
set -x
apt update \
&& apt -y install sudo vim curl wget unzip tcpdump net-tools iproute2 vim jq coreutils tini gdisk apt-transport-https ca-certificates software-properties-common gnupg1 gnupg2\
&& apt -y autoremove \
&& apt -y clean
# 禁用防火墙
# debian
ufw disable
# centos
systemctl stop firewalld
systemctl disable firewalld
# 禁用swap
swapoff -a
# 永久禁用swap
cat /etc/fstab
cat /etc/fstab | grep -v swap > /etc/fstab
cat /etc/fstab
# https://unix.stackexchange.com/questions/671940/disabling-swap-on-debian-permanently
# https://wiki.archlinux.org/title/swap#Disabling_swap
systemctl --type swap
systemctl mask dev-sdb3.swap
# 永久禁用SELINUX
tee <<-EOF /etc/selinux/config
SELINUX=disabled
EOF
# mount disk
# fdisk -l
# mount -l
# fdisk /dev/sdb
# mkfs.ext4 -G 4096 /dev/sdb1
# 挂载 /etc/fstab
# 查看uuid blkid
# UUID=6ee00141-8904-4734-8096-d95bf7ac645f /data ext4 defaults 0 0