debian13安装最小化安装
1. 在安装过程中遇到的 软件源,获取不到,就先跳过
2. 安装成功后,再次开机,用root登录,发现没有ssh
3. 需要先配置源,注意要用 https,参考 https://mirrors.ustc.edu.cn/, 这个里面写的不对,一定要改成https
nano /etc/apt/sources.list
把上面的cdrom 的源,注释掉
把下面的一行一行的写进去
# 默认注释了源码仓库,如有需要可自行取消注释
deb https://mirrors.ustc.edu.cn/debian trixie main contrib non-free non-free-firmware
# deb-src http://mirrors.ustc.edu.cn/debian trixie main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian trixie-updates main contrib non-free non-free-firmware
# deb-src http://mirrors.ustc.edu.cn/debian trixie-updates main contrib non-free non-free-firmware
# backports 软件源,请按需启用,推荐开启
deb https://mirrors.ustc.edu.cn/debian trixie-backports main contrib non-free non-free-firmware
# deb-src http://mirrors.ustc.edu.cn/debian trixie-backports main contrib non-free non-free-firmware
4. 配饰ssh
sudo apt update
sudo apt install openssh-server
出于安全考虑,Debian 默认禁止使用
root 账户通过密码直接 SSH 登录。如果你需要远程用 root 登录,需要修改 SSH 配置文件:- 编辑配置:
sudo nano /etc/ssh/sshd_config - 找到
PermitRootLogin这一行,将其改为yes(即PermitRootLogin yes)。 - 重启 SSH 服务使其生效:
sudo systemctl restart ssh
5. 连接上后需要告警
Connecting to xxxx:22...
Connection established.
To escape to local shell, press Ctrl+Alt+].
Linux debian 6.12.94+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.94-1 (2026-06-20) x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
/usr/bin/xauth: file /home/zzz/.Xauthority does not exist
创建一下文件就行了
zzz@debian:~$ touch /home/zzz/.Xauthority
6. 非root用户没有sudo权限
zxc@debian:~$ sudo apt update
-bash: sudo: 未找到命令
sudo 命令未找到,这在 Debian 最小化安装中非常常见,因为 sudo 并不是默认安装的软件包。
#切换root
su -
#安装sudo
apt update
apt install sudo
#将你的用户加入 sudo 组
usermod -aG sudo zxc
#这个命令失败
#在 Debian 最小化安装中,usermod 命令未找到,通常是因为系统环境变量 PATH 未包含 /usr/sbin 目录,而 usermod 正位于该目录下。这并非命令缺失,而是路径配置问题。
/usr/sbin/usermod -aG sudo zxc
#永久修复 PATH
echo 'export PATH=$PATH:/usr/sbin' >> ~/.bashrc
source ~/.bashrc
exit

浙公网安备 33010602011771号