1、将折腾坏了的实例的引导卷挂载到同账号其他甲骨文实例。
执行 lsblk 看看挂载的卷设备名,一般是 sdb,
救砖甲骨文 AMD 执行
Debian 11
curl -Lo- "https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-nocloud-amd64.tar.xz" | tar -xJO | dd of=/dev/sdb bs=1MDebian 12
curl -Lo- "https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-nocloud-amd64.tar.xz" | tar -xJO | dd of=/dev/sdb bs=1M救砖甲骨文 ARM 执行
Debian 11
curl -Lo- "https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-nocloud-arm64.tar.xz" | tar -xJO | dd of=/dev/sdb bs=1MDebian 12
curl -Lo- "https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-nocloud-arm64.tar.xz" | tar -xJO | dd of=/dev/sdb bs=1MDD 过程大约 2~3 分钟。
2、完成后分离卷挂载回原实例,启动实例。
3、点击“控制台连接”下级菜单的 启动“Cloud Shell 连接”。
强制重启实例。
看到实例启动后,使用用户名 root 和 空密码 登录实例。
用命令 passwd 设置 root 密码。
apt update #更新系统
apt install ssh wget curl -y #安装 ssh
grep -qw "^PermitRootLogin" /etc/ssh/sshd_config && sed -i 's/PermitRootLogin .*/PermitRootLogin yes/g' /etc/ssh/sshd_config || sed -i 's/#PermitRootLogin .*/PermitRootLogin yes/g' /etc/ssh/sshd_config; #允许root用户登录
grep -qw "^PasswordAuthentication" /etc/ssh/sshd_config && sed -i 's/PasswordAuthentication .*/PasswordAuthentication yes/' /etc/ssh/sshd_config || sed -i 's/#PasswordAuthentication .*/PasswordAuthentication yes/' /etc/ssh/sshd_config #允许密码验证
ssh-keygen -A #生成主机密钥
systemctl start sshd #启用 ssh 服务
评论 (0)
评论已关闭