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. STL-vector模拟实现

    #pragma once #include<assert.h> #include<iostream> using std::cout; using std::endl; usi ...

  2. 前端css阴影画图

    在线演示地址:css阴影画图 一,在css中有一个box-shadow属性,可以设置元素的阴影. .item{ width: 50px; height: 50px; background: #0096 ...

  3. CPNtools协议建模安全分析---实例(二)

    首先,token值是变迁的内部的,当变迁点火触发的时候token才会在网络中移动.在颜色Petri网中token是有区分的. 1.我么现在举一个学生吃饼的例子 ,颜色这样定义.    s表示一个学生类 ...

  4. 软件推荐: Sourcetree git软件

    注意事项: 破解的时候,json文件目录不是软件exe所在目录,是数据目录 %LocalAppData%\Atlassian\SourceTree 还有就是第一次运行弹出个 有个插件要不要用,选第3个 ...

  5. react build 后,打包后自动将index.html copy 404.html - create-react-app 创建的项目

    起因:build上传gitee,启用路由需要404.html自动跳转 当前环境 create-react-app 搭建的架子 解决方案 由于默认的时候把build.js打包,无法查看,只好eject ...

  6. C++追根究底(持续更新)

    目录 头文件 " " 与 <>的区别 带 .h 和不带 .h 的区别 带 c前缀 和不带 c前缀 的区别 宏定义 特殊符号:#,##,#@ 防止一个头文件被重复包含 d ...

  7. Hamming(汉明)窗的原理介绍及实例解析

    概念   在数字信号处理过程中,每次FFT变换只能对有限长度的时域数据进行变换,因此,需要对时域信号进行信号截断.即使是周期信号,如果截断的时间长度不是周期的整数倍(周期截断),那么,截取后的信号将会 ...

  8. PBKDF2算法:保障密码安全的利器

    PBKDF2算法起源: PBKDF2(Password-Based Key Derivation Function 2)算法是一种基于密码的密钥派生函数,最初由RSA实验室的密码学家提出,用于从密码中 ...

  9. PAT 甲级【1009 Product of Polynomials】

    /* 系数为0不输出 貌似runtime异常也显示答案不正确*/ import java.io.BufferedReader; import java.io.IOException; import j ...

  10. window10-yarn-使用vite创建vue3项目失败-文件夹或目录不正确

    前置条件 window10 本地已经安装nodejs yarn已经通过npm全局安装(npm install -g yarn) 问题 yarn脚手架方式搭建vue3项目失败(command faile ...