Vultr 修改 Root 密码

有的用户可能须要重置修改 Vultr VPS 的 Root 帐户密码,好比当咱们从快照恢复时,Root 密码与原 VPS 相同,这时用新密码是链接不上的。本文就介绍下如何修改 Vultr 的 Root 密码。linux

Vultr 官方修改 Root 密码方法:Reset Root Passwordbash

Vultr 修改 Root 密码

须要注意的是,不一样系统的修改方法略有差异,这里以 CentOS 7 为例演示,其它系统的修改方法会列在后面。code

CentOS 7

一、访问控制台,打开在线 Console,点击右上角的 “Send CtrlAltDel”,而后按 ESC 键启动 GRUB boot prompt。orm

 
image.png
 
image.png

二、出现上图界面后,按 e 编辑第一启动项。按 “下方向键” 向下移动光标,找到以 “linux16” 开头这行,将 ro 改成 rw init=/sysroot/bin/shrem

 
image.png

三、修改好后,按 Ctrl + X 启动单用户模式。输入 chroot /sysroot 回车进入系统,输入 passwd 开始修改 root 密码。get

 
image.png

修改为功后输入 reboot -f ,回车重启完成修改。it

Debian,Ubuntu

  1. 访问控制台,打开在线 Console,点击右上角的 “Send CtrlAltDel”,按 ESC 键启动 GRUB boot prompt。
  2. 按 e 编辑第一启动项。按 “下方向键” 向下移动光标,找到以“linux / boot /”开头这行,在该行的末尾添加init =“/ bin / bash”;
  3. 按 Ctrl + X 启动,输入 mount -rw -o remount / (Ubuntu 17.04,命令可能须要改成 mount -o remount,rw /),而后输入 passwd 来更改 root 密码,而后从新启动。

CentOS 6

  1. 访问控制台,打开在线 Console,点击右上角的 “Send CtrlAltDel”。
  2. 您将看到一个 GRUB 引导提示符,在 GRUB 提示符处,键入 a 以附加到引导命令,添加文本“single”,而后按回车;
  3. 系统将启动,看到根提示后,键入 passwd 更改 root 密码,而后从新启动。