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 ...
随机推荐
- Java 多线程------创建多线程的方式二:实现 Runnable接口 + 比较创建线程的两种方式:
1 package com.bytezero.threadexer; 2 3 /** 4 * 5 * 创建多线程的方式二:实现 Runnable接口 6 * 1.创建一个实现了Runnable接口类 ...
- Java 重写引入
1 package com.bytezero.override; 2 /* 3 * 方法的重新(override/overwrite) 4 * 5 * 1.重写:子类继承父类以后,可以对父类中同名同参 ...
- 一个简单的RTMP服务器实现 --- RTMP复杂握手(Complex Handshake)
PS:要转载请注明出处,本人版权所有. PS: 这个只是基于<我自己>的理解, 如果和你的原则及想法相冲突,请谅解,勿喷. 前置说明 本文作为本人csdn blog的主站的备份.(Bl ...
- HISI3520DV300 折腾记录(一)之 《Uboot-Start.S分析 以及 相关启动流程分析》
PS:要转载请注明出处,本人版权所有. PS: 这个只是基于<我自己>的理解, 如果和你的原则及想法相冲突,请谅解,勿喷. 前置说明 本文作为本人csdn blog的主站的备份.(Bl ...
- 关于linux在笔记本下耗电的解决方案(只写我实践的部分)
PS:要转载请注明出处,本人版权所有. PS: 这个只是基于<我自己>的理解, 如果和你的原则及想法相冲突,请谅解,勿喷. 前置说明 本文发布于 2014-09-22 12:02:54 ...
- 打造餐饮+元宇宙新体验!实时云渲染赋能DQverse未来世界
随着元宇宙的迅猛发展,实体餐饮产业与虚拟元宇宙之间的交汇愈发频繁.诸如海底捞.奈雪的茶.星巴克.王老吉.肯德基等知名餐饮品牌纷纷加大对元宇宙领域的投资与布局. 图源网络 最初只是线上虚拟餐厅的概念,如 ...
- 三维模型3DTile格式轻量化在数据存储的重要性分析
三维模型3DTile格式轻量化在数据存储的重要性分析 三维模型3DTile格式轻量化在数据存储中占有重要地位.随着科技的不断发展,尤其是空间信息科技的进步,人们对于三维地理空间数据的需求日益增长.然而 ...
- .Net 8.0 除gRPC之外的另一个选择,IceRPC之快束开始HelloWorld
作者引言 很高兴啊,我们来到了第一篇,程序员的HelloWorld,快速开始RPC之游 快速入门 演示如何在几分钟内,使用IceRPC,构建和运行一个完整的客户端-服务器(C/S)应用程序. 必要条件 ...
- RSA算法揭秘:加密世界的守护者
RSA算法起源: RSA算法是由Ron Rivest.Adi Shamir和Leonard Adleman在1977年共同提出的.它是一种非对称加密算法,基于两个大素数的乘积难以分解的数论问题.RSA ...
- 记录--图解 Vue 响应式原理
这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助 最近部门分享,有同学提到了 Vue 响应式原理,大家在讨论时,发现一些同学对这一知识理解还不够深入,不能形成一个闭环,为了帮助大家理解这个 ...