Access Single User Mode (Reset Root Password)--CentOS 修改root密码
Access Single User Mode (Reset Root Password)
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
- 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.
- 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)
- At the GRUB prompt, type "a" to append to the boot command.
- Add the text "single" and press enter.
- System will boot and you will see the root prompt. Type "passwd" to change the root-password and then reboot again.
CentOS 7
- 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.
- 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.
- 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)
- Find the kernel line (starts with "linux16"), change
rotorw init=/sysroot/bin/sh. - Press CTRL-X or F10 to boot single user mode.
- Access the system with the command:
chroot /sysroot. - Run
passwdto change the root password. - Reboot the system:
reboot -f.
Debian, Ubuntu
- 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.
- 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.
- 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)
- 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). - Press CTRL-X or F10 to boot.
- 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:
- 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.
- 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)
- At the end of the line that begins with "linux$" add " coreos.autologin=tty1" (no quotes).
- Press CTRL-X or F10 to boot. You will be logged in as "core" when the system boots.
- 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密码的更多相关文章
- CentOS修改用户密码方法
CentOS修改用户密码方法 CentOS修改用户密码方法 1. 普通用户 a. 获取超级用户root权限 命令:su或者su -或者su - root b. passwd 用户名 2. 超级用户 a ...
- CentOS 修改用户密码
CentOS 修改用户密码 1.普通用户 ①获取超级用户root权限 命令:su 或者 su- 或者 su -root ②输入命令: passwd 用户名 ③输入新密码 2.超级用户 ①打开syste ...
- RedHat/Centos修改root密码
Linux主机忘记密码,只要你能接触物理主机都可以修改root密码的! Redhat6.x 5.x / Centos6.x 5.x 01.开机-空格/enter 02.e-编辑模式 CentO ...
- ansible非root用户批量修改root密码
前言: 由于线上服务器密码长久没有更新,现领导要求批量更换密码.线上的之前部署过salt,但由于各种因素没有正常使用. 使用自动化工具批量修改的计划搁浅了,后来领导给了个python多线程修改密码脚本 ...
- centos修改mysql密码或者进入mysql后解决Access denied for user ''@'localhost' to database 'mysql错误
原因是MySQL的密码有问题 用mysql匿名用户可以进入数据库,但是看不见mysql数据库. 解决办法:具体操作步骤:关闭mysql:# service mysqld stop然后:# mysqld ...
- CentOS修改root密码
1.在系统启动时,按任意键中止启动 2.按E键修改系统启动文件 3.找到linux16开头的行,把整行ro后面内容删除,添加rd.break 4.Ctrl+X更改并重启 5.重新挂载/sysroot ...
- 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 ...
- mysql forget root password
http://www.rackspace.com/knowledge_center/article/mysql-resetting-a-lost-mysql-root-password MySQL - ...
- mysql5.7.11修改root默认密码
知道 MySQL 出了5.7了,并且网上说性能提高了一两倍,于是在虚拟机上安装了个 CentOS 7,在上面安装 MySQL 5.7 我使用的是 yum安装方式,要求虚拟机能够上网,因为它会在线下载安 ...
- MySQL 修改 root 密码命令
安装好 MySQL 并成功启动 MySQL 服务后,可以通过以下方法修改root密码: ①用 mysqladmin.exe 操作.指令如下: cd C:\Program Files\MySQL Ser ...
随机推荐
- 今天接到一个根据excel来更新数据库的需求,用php写个小脚本
需求大概内容是,excel中有些条目需要删除.有些需要新增,就需要基于这份excel生成删.增的SQL. 要求是这样的:蓝色要删除的,黄色是要新增的,白色和灰色的不用管. 我第一时间就在想:还得识别单 ...
- VSCode 配置 Spring Boot 项目开发环境
神器IDEA在升级到2023之后越发卡顿, EDU邮箱也不能用了, 照现在这个JDK版本的升级速度, 神器不升级也不行, 需要开始物色替代品. 其它IDE我用得少, VSCode还是比较熟悉的, 可以 ...
- 本地画板工具 Axure RP 9 顶替 drawio (补充Axure RP 8)
本地画板工具 Axure RP 9 顶替 drawio 外链:https://wws.lanzoul.com/b03paemkf 密码:dmvj 9这个版本 win7 不支持 Axure RP 8 h ...
- 解决Windows下json.hpp中文乱码问题
文中使用的是 json 库,整个库的代码由一个单独的头文件json.hpp组成,用普通的C++11编写的.它没有库,没有子项目,没有依赖关系,没有复杂的构建系统,使用起来很方便. 先引用头文件和命名空 ...
- linux-关于conio.h文件的文件缺失问题
链接: https://pan.baidu.com/s/1Qzo4CkJB1_5E-3rDLtfG4Q 提取码: fh65 编辑以下这个依赖库就可以了 $ cd libconio-1.0.0 $ ./ ...
- PAT甲级【1014 Waiting in Line】
考察双向链表 import java.io.IOException; import java.io.InputStreamReader; import java.io.StreamTokenizer; ...
- Linux 运维工程师面试真题-5-常考题目汇总
Linux 运维工程师面试真题-5-常考题目汇总 1.解释下什么是 GPL,GNU,自由软件? GPL:(通用公共许可证):一种授权,任何人有权取得.修改.重新发布自由软件的权力. GNU:(革奴计划 ...
- JS(循环)
一 for循环 在程序中,一组被重复执行的语句被称之为循环体,能否继续重复执行,取决于循环的终止条件.由循环体及循环的终止条件组成的语句,被 称之为循环语句 1 语法结构 for循环主要用于把某些代码 ...
- 记录--JS精粹,原型链继承和构造函数继承的 “毛病”
这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助 先从面向对象讲起,本瓜认为:面向对象编程,它的最大能力就是:复用! 咱常说,面向对象三大特点,封装.继承.多态. 这三个特点,以" ...
- 记录--Vue PC前端扫码登录
这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助 需求描述 目前大多数PC端应用都有配套的移动端APP,如微信,淘宝等,通过使用手机APP上的扫一扫功能去扫页面二维码图片进行登录,使得用户 ...