修复linux密码
2015-09-15 14:39
666 查看
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:
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.
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
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.
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.
Read more at: https://www.vultr.com/docs/boot-into-single-user-mode-reset-root-password
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.
Debian, Ubuntu, 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 "linux /boot/") and add init="/bin/bash" at the end of the line
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
Resetting the administrator password on Windows Server 2012 is not possible on Vultr. If you have recently installed your VPS, we recommend reinstalling the OS.Read more at: https://www.vultr.com/docs/boot-into-single-user-mode-reset-root-password
相关文章推荐
- CentOS6.5下安装xampp
- Centos自动调整错误路径
- Linux_使用Linux之安装jdk 7
- linux线程5(百度知道上一道题)
- CentOS 6.5系统搭建SVN服务
- linux线程4(google面试题)
- 史上最详细的虚拟机上安装Linux教程
- linux命令行安装matlab
- Linux 环境下思源黑体字体与 Java 之间的兼容性问题的解决
- linux下使用ramdisk的一点认识
- centos7下使用yum安装mysql
- Linux鸟哥私房菜学习笔记--第九章
- Linux 下安装ffmpeg(xlib264 yams)
- Linux 下ffmpeg的安装(xlib264 yams)
- CentOS 安装python MySQLdb模块
- 左右GNU Linux企业加密文件系统 eCryptfs简介
- linux挂载光盘
- unix/linux共享内存应用与陷阱
- linux下彻底卸载MySQL
- 马哥-51CTO-Linux培训-0905-Linux任务计划