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 ...
随机推荐
- 没想到,JDBC 驱动会偷偷修改 sql_mode 的会话值
最近碰到一个 case,值得分享一下. 现象就是一个 update 操作,在 mysql 客户端中执行提示 warning,但在 java 程序中执行却又报错. 问题重现 mysql> crea ...
- Java 一悟结束异常处理 Biu丶
- MongoDB可视化compass 连接数据库失败Invalid UTF-8 string in BSON document
An error occurred while loading navigation: Invalid UTF-8 string in BSON document 出现这个问题建议降低compass版 ...
- 封装svg通用组件
安装vite-plugin-svg-icons插件 pnpm i vite-plugin-svg-icons -D 在main.ts中引入vite-plugin-svg-icons import 'v ...
- vim技巧--提取文本与文本替换
前几天遇到一个使用情景,需要从一个包含各个读取代码文件路径及名字的文件中把文件路径提取出来,做一个filelist,这里用到了文本的提取和替换,这里做个小总结记录一下. 从网上找了一个作者写的代码用来 ...
- settings.json 20201209
李昱版 { "editor.fontSize": 20, "workbench.iconTheme": "material-icon-theme&qu ...
- 简单实用算法——位图算法(BitMap)
目录 算法原理 优点和缺点 算法实现(C#) 算法应用 参考文章 算法原理 BitMap的基本思想就是用一个bit位来标记某个元素对应的Value,而Key即是该元素.由于采用了Bit为单位来存储数据 ...
- vite中配置less,vue3中配置less
前言 如果赶时间请直接使用目录跳到解决问题的部分. 使用的项目使用vue脚手架生成. npm init vue@latest 版本如下 "@vitejs/plugin-vue": ...
- [LeetCode] 5933. k 镜像数字的和
一.摘要 本文介绍了一种通过模拟寻找十进制镜像数字,然后判断其对应的k进制表示是否也是镜像的方法.具体来讲即从小到大遍历10进制的镜像数字,然后对10进制镜像数字转为k进制,然后判断转为k进制后是否还 ...
- 记录--JS 的垃圾回收机制
这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助 前言 垃圾回收(Garbage Collection)是一种内存管理机制,用于检测和清理不再被程序使用的内存,这些不再被使用的内存就被称为 ...