虚拟机安装Debian

下载镜像

http://mirrors.163.com/debian-cd/10.7.0/amd64/iso-cd/debian-10.7.0-amd64-netinst.iso

下载完成后, 打开 PD, 选择镜像安装即可, 在选择安装软件时我选择的: ssh server 和 标准工具集

易用性配置

root 用户登录

安装完成后, 修改配置以允许 root 用户 ssh 登录

1
2
3
4
5
6
7
cd /etc/ssh/
vim sshd_config

# 如下项修改
LoginGraceTime 120m
PermitRootLogin yes
StrictModes yes

修改 hostname

1
hostnamectl set-hostname custom-hostname

替换阿里源

备份

1
cp /etc/apt/sources.list /etc/apt/sources.list.bak

创建新的 sources.list, 粘贴如下内容

vim sources.list

1
2
3
4
5
6
7
8
9
deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb http://mirrors.aliyun.com/debian-security buster/updates main
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib

deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb-src http://mirrors.aliyun.com/debian-security buster/updates main
deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib

其他源参考: https://cloud.tencent.com/developer/article/1590080

常用软件安装

1
apt install curl vim