救砖救鸡方式一:甲骨文vps忘记root密码怎么办?使用netboot重置实例的root密码
金箍棒#救砖 #救机 #救鸡 #netboot #忘记密码 #重置密码
适用的操作系统
本文测试过ubuntu20.04/Debian 11/12
前置教程
在学习本文之前,你需要先学习进入控制台,看下文:
1.甲骨文实例控制台连接CloudShell连接(及vnc连接)及进入bios的教程(救砖前置教程)
在学习本文之前,你需要先学习引导进入netboot的方法:
2.甲骨文云实例通过控制台(VNC)连接引导到Netboot的方法(救砖前置教程)(重置密码前置教程)
本文关键操作点
注:学习本文,必须先学习上面的【前置教程】的内容,否则本文是完全无法进行的
注2:本文的截图比较多,但是实际操作步骤并不是十分复杂
目前你应该已经进入到netboot了,下面需要的关键操作点
①amd重置密码操作
②arm重置密码操作
注:本文参考教程(就是抄的):龘龘的博客 - 甲骨文通过VNC和netboot重置密码 (3dm.pw)
具体的操作步骤:
①amd重置密码操作
1.netboot界面选择 Utilities(UEFI)

2.选择Kernel cmdline params,

3.输入console=ttyS0,9600
,回车,

4.ESC退出到主页面
5.继续进行下面的②arm重装系统的步骤
②arm重置密码操作
选择[ Linux Network Installs (64-bit)]

x选择[Debian] ,不管是ubuntu,还是debian,都选Debian

选择[Debian 12.0 (bookworm)] ,不管是什么版本,都选12.0

选择[Rescue Mode]

下面只截图关键的部分,这里有9个直接回车的操作;
[[!!] Select a language ]选择[English]直接回车;
[[!!] Select your location]直接回车;
[[!!] Configure the keyboard]直接回车;
[[!] Configure the network-Hostname:]直接回车;
[[!] Configure the network-Domain name:]直接回车;
[[!] Choose a mirror of the Debian archive-Debian archive mirror country: ]直接回车;
[[!] Choose a mirror of the Debian archive-Debian archive mirror:]直接回车;
[[!] Choose a mirror of the Debian archive-HTTP proxy information (blank for none):]直接回车;
[[!] Configure the clock]直接回车;
关键点截图来了
[[!!] Enter rescue mode]需要根据实际情况选择,通常是【sda1】;

[ [!!] Enter rescue mode]选择[Yes]直接回车;

[[!!] Enter rescue mode]选择[Execute a shell in /dev/sda1];

[ Executing a shell]选择[<Continue>]直接回车,

这个时候页面的最底部出现[root@debian:/#],

输入passwd,然后输入两次密码

输入exit,然后选择system reboot重启
如果原系统没有root账号登录,还想开启root,需要运行下面的语句
echo root:你的密码 | chpasswd root sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config rm -rf /etc/ssh/sshd_config.d/* && rm -rf /etc/ssh/ssh_config.d/* /etc/init.d/ssh* restart
开始愉快的玩耍吧~!
更多的DD教程
请查看->甲骨文实例dd/救砖/vnc/教程
相关阅读
↓↓↓↓相关阅读-点击下方的链接查看更多↓↓↓↓
本系列的订阅频道->https://t.me/jingubang_sub