Access Single User Mode (Reset Root Password)

Published on: Wed, Sep 17, 2014 at 12:52 pm EST

To reset the root password of your server, you will need to boot into single user mode.

Access the Manage section of your server in the customer portal and follow these steps. The option depends on the bootloader version on the machine:

CentOS 6

  1. Click [View Console] to access the console and click the send CTRL+ALT+DEL button on the top right. Alternatively, you can also click [RESTART] to restart the server.
  2. You will see a GRUB boot prompt telling you to press any key - you have only a few seconds to press a key to stop the automated booting process. (If you miss this prompt you will need to restart the VM again)
  3. At the GRUB prompt, type "a" to append to the boot command.
  4. Add the text "single" and press enter.
  5. System will boot and you will see the root prompt. Type "passwd" to change the root-password and then reboot again.

CentOS 7

  1. Click [View Console] to access the console and click the send CTRL+ALT+DEL button on the top right. Alternatively, you can also click [RESTART] to restart the server.
  2. As soon as the boot process starts, press ESC to bring up the GRUB boot prompt. You may need to turn the system off from the control panel and then back on to reach the GRUB boot prompt.
  3. You will see a GRUB boot prompt - press "e" to edit the first boot option. (If you do not see the GRUB prompt, you may need to press any key to bring it up before the machine boots)
  4. Find the kernel line (starts with "linux16"), change ro to rw init=/sysroot/bin/sh.
  5. Press CTRL-X or F10 to boot single user mode.
  6. Access the system with the command: chroot /sysroot.
  7. Run passwd to change the root password.
  8. Reboot the system: reboot -f.

Debian, Ubuntu

  1. Click [View Console] to access the console and click the send CTRL+ALT+DEL button on the top right. Alternatively, you can also click [RESTART] to restart the server.
  2. As soon as the boot process starts, press ESC to bring up the GRUB boot prompt. You may need to turn the system off from the control panel and then back on to reach the GRUB boot prompt.
  3. You will see a GRUB boot prompt - press "e" to edit the first boot option. (If you do not see the GRUB prompt, you may need to press any key to bring it up before the machine boots)
  4. Find the kernel line (starts with "linux /boot/") and add init="/bin/bash" at the end of the line (On CentOS 7, the line may start with linux16).
  5. Press CTRL-X or F10 to boot.
  6. System will boot and you will see the root prompt. Type "mount -rw -o remount /" and then "passwd" to change the root password and then reboot again.

FreeBSD

The boot menu has an option to boot into single-user mode. Press the key for single user mode (2). At the root prompt, type "passwd" to change the root password and then reboot again.

CoreOS

CoreOS by default uses SSH key authentication. On Vultr, a root user and password are created. If an SSH key is selected when creating the VPS, this SSH key can be used to login as user "core".

It is possible to reset the standard root login by executing "sudo passwd" as user "core". Login as "core" using the SSH key first.

If you lost your SSH key, then you can login as the "core" user by editing the grub loader. Follow these steps:

  1. Click [View Console] to access the console and click the send CTRL+ALT+DEL button on the top right. Alternatively, you can also click [RESTART] to restart the server.
  2. You will see a GRUB boot prompt - press "e" to edit the first boot option. (If you do not see the GRUB prompt, you may need to press any key to bring it up before the machine boots)
  3. At the end of the line that begins with "linux$" add " coreos.autologin=tty1" (no quotes).
  4. Press CTRL-X or F10 to boot. You will be logged in as "core" when the system boots.
  5. Remember to reboot your server after you have reset your login.

Windows Server 2012

See this guide for instructions on how to reset the administrator password on Windows Server 2012.

Access Single User Mode (Reset Root Password)--CentOS 修改root密码的更多相关文章

  1. CentOS修改用户密码方法

    CentOS修改用户密码方法 CentOS修改用户密码方法 1. 普通用户 a. 获取超级用户root权限 命令:su或者su -或者su - root b. passwd 用户名 2. 超级用户 a ...

  2. CentOS 修改用户密码

    CentOS 修改用户密码 1.普通用户 ①获取超级用户root权限 命令:su 或者 su- 或者 su -root ②输入命令: passwd 用户名 ③输入新密码 2.超级用户 ①打开syste ...

  3. RedHat/Centos修改root密码

    Linux主机忘记密码,只要你能接触物理主机都可以修改root密码的!   Redhat6.x 5.x  / Centos6.x  5.x 01.开机-空格/enter 02.e-编辑模式 CentO ...

  4. ansible非root用户批量修改root密码

    前言: 由于线上服务器密码长久没有更新,现领导要求批量更换密码.线上的之前部署过salt,但由于各种因素没有正常使用. 使用自动化工具批量修改的计划搁浅了,后来领导给了个python多线程修改密码脚本 ...

  5. centos修改mysql密码或者进入mysql后解决Access denied for user ''@'localhost' to database 'mysql错误

    原因是MySQL的密码有问题 用mysql匿名用户可以进入数据库,但是看不见mysql数据库. 解决办法:具体操作步骤:关闭mysql:# service mysqld stop然后:# mysqld ...

  6. CentOS修改root密码

    1.在系统启动时,按任意键中止启动 2.按E键修改系统启动文件 3.找到linux16开头的行,把整行ro后面内容删除,添加rd.break 4.Ctrl+X更改并重启 5.重新挂载/sysroot ...

  7. Proxmox Reset Root Password

    http://c-nergy.be/blog/?p=1777 Step 1 – Boot your Proxmox VE machine. In the boot menu screen, you s ...

  8. mysql forget root password

    http://www.rackspace.com/knowledge_center/article/mysql-resetting-a-lost-mysql-root-password MySQL - ...

  9. mysql5.7.11修改root默认密码

    知道 MySQL 出了5.7了,并且网上说性能提高了一两倍,于是在虚拟机上安装了个 CentOS 7,在上面安装 MySQL 5.7 我使用的是 yum安装方式,要求虚拟机能够上网,因为它会在线下载安 ...

  10. MySQL 修改 root 密码命令

    安装好 MySQL 并成功启动 MySQL 服务后,可以通过以下方法修改root密码: ①用 mysqladmin.exe 操作.指令如下: cd C:\Program Files\MySQL Ser ...

随机推荐

  1. vagrant 多个box的操作|共享目录失败

    本来机器上已经有一个Ubuntu的box了,今天想在安装一个centos的box,结果还折腾了很长时间. 多个机器的命令 添加box的时候需要使用名称,一个的时候可以忽略名称 vagrant box ...

  2. 3 - 任务调度算法 & 同步与互斥 &队列

    之前的都是按照优先级不同允许抢占(不讲道理),不管你在做什么,轮到优先级最高的任务,直接抢占执行 怎样才能讲道理呢?稍微等等嘛,等我做完活你再做   1 支持抢占,0不支持抢占  同优先级任务是否交替 ...

  3. [转] VSCode中 Vetur插件排版Vue文件 Col 标签子标签不被缩进的问题 iview viewDesign 自动格式化

    [转] VSCode中 Vetur插件排版Vue文件 Col 标签子标签不被缩进的问题 iview viewDesign 自动格式化 问题 Col标签不对齐 首先直接放解决办法 在 vsCode se ...

  4. PowerShell alias - cmd中设置别名 快捷的执行命令

    Step. 1: 发现需求 最近学nest.js发现,都是用命令创建工程文件,然后教程里面都是用的快捷命令 比如 pd = pnpm run dev pb = pnpm run build 但是我这里 ...

  5. 音频信号质量的度量标准--MOS得分的由来

    早期语音质量的评价方式是凭主观的,人们在打通电话之后通过人耳来感知语音质量的好坏.1996年国际ITU组织在ITU-T P.800和P.830建议书开始制订相关的评测标准:MOS(Mean Opini ...

  6. java多线程的锁整理

    参考,欢迎点击原文:https://www.jianshu.com/p/473a3d96a1b0(java锁总结) https://www.jianshu.com/p/dcabdf695557(Ree ...

  7. 记录--Vue自动生成组件名

    这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助 unplugin-generate-component-name 一款用于以文件夹名或者setup标签写入名字来自动生成Vue组件名的插件 ...

  8. 记录--JavaScript原型和原型链复习笔记

    这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助 原型和原型链 1. 原型 每个JS对象一定对应一个原型对象,并从原型对象继承属性和方法 1.1 __proto__ 对象的__proto_ ...

  9. QT 智能指针 QPointer QScopedPointer QSharedPointer QWeakPointer QSharedDataPointer 隐式共享 显示共享

    QPointer QPointer 使一种受保护的指针,当其引用的对象被销毁时,它会被自动清除(但是,销毁引用对象还是必须手动delete).QPointer所指向的对象必须是QObject或其派生类 ...

  10. Python 汇总列数据到行

    Python汇总Excel列数据到行(方法一) import pandas as pd # 读取Excel文件 df = pd.read_excel('C:\\Users\\liuchunlin2\\ ...