一、操作系统下载

官网:https://ubuntu.com/

国内镜像:https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/

https://mirrors.aliyun.com/oldubuntu-releases/releases/?spm=a2c6h.25603864.0.0.63826f0fGEzROq

二、安装系统

三、更新系统

apt update

四、启用root用户

#设置root密码
sudo passwd root

#启用root用户
sudo passwd -u root

#检查root用户是否已经启用
cat /etc/passwd

#切换到root
su - root

五、安装ssh并启用

apt install -y openssh-server

#编辑SSH配置文件

sudo nano /etc/ssh/sshd_config

#允许root登录

在配置文件中找到PermitRootLogin行,并将其更改为yes

PermitRootLogin yes

#保存更改

保存并退出编辑器。按Ctrl + X,然后按Y确认更改,最后按Enter键保存文件。

#重启SSH服务

sudo systemctl restart sshd