Linux Debian系统安装
debian系统
1.系统安装
参考:https://blog.csdn.net/ziqibit/article/details/130060173
2.系统初始化
2.1 打开root权限登录
vi /etc/ssh/sshd_config
#添加如下
PermitRootLogin yes
PasswordAuthentication yes
#重启sshd
/etc/init.d/ssh restart
2.2 配置网络
建议用nmtui配置网络!
如有特殊需求再按照如下方式去配置!
vi /etc/network/interfaces
##以下是配置固定IP的方法
## 开机自启
auto ens33
## 开启配置热生效
allow-hotplug ens33
## static静态,dhcp动态
iface ens33 inet static
## 静态IP地址
address 192.168.0.230
## 子网掩码
netmask 255.255.255.0
## 默认网关
gateway 192.168.0.1
##配置DNS
vi /etc/resolve.conf
nameserver 114.114.114.114
#关闭NetworkManager并重启网卡(建议不关闭NetworkManager,用nmtui配置地址)
systemctl stop NetworkManager
systemctl disable NetworkManager
systemctl restart networking.service
2.3 配置阿里源
cp /etc/apt/sources.list /etc/apt/sources.list.bak
vi /etc/apt/sources.list
##清空并添加如下内容(二选一)
##阿里源
deb https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian-security/ bookworm-security main
deb-src https://mirrors.aliyun.com/debian-security/ bookworm-security main
deb https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib
##腾讯源(可选)
deb https://mirrors.tencent.com/debian/ bookworm main non-free non-free-firmware contrib
deb-src https://mirrors.tencent.com/debian/ bookworm main non-free non-free-firmware contrib
deb https://mirrors.tencent.com/debian-security/ bookworm-security main
deb-src https://mirrors.tencent.com/debian-security/ bookworm-security main
deb https://mirrors.tencent.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb-src https://mirrors.tencent.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb https://mirrors.tencent.com/debian/ bookworm-backports main non-free non-free-firmware contrib
deb-src https://mirrors.tencent.com/debian/ bookworm-backports main non-free non-free-firmware contrib
#保存后更新
sudo apt-get update
#安装常用网络工具
apt install -y net-tools nmap tcpdump iperf curl vim openvpn git wget
2.4 设置ll命令
cd /root/
vim .bashrc
#把下面这行的注释取消掉
alias ll='ls $LS_OPTIONS -l'
#使其生效
source .bashrc
2.5 安装firewalld防火墙
apt install firewalld -y