CentOS 7
其实原本是两篇分开的文章 CentOS 6 和 7,站点迁移的时候顺便把俩合并了,凑合着看吧。
SSH 接入
略,略略略略略略略略略
重启机子
这里以 vultr 为例子 点击Send CtrlAltDel
,然后按 e 进入编辑模式
single
找到这一行,加入如图所示的黄线内容
然后按下 Ctrl+X
引导机子
重置密码
接着输入passwd
开始密码重置操作 确认一遍后 输入 exec /sbin/init
来重新启动,按照要求输入新密码
Reboot
最后进入系统后 输入reboot
来重新启动,确保一切正常。
CentOS 6
ssh 登录修改
如果用 ssh 登录,操作会比较便捷。 在 terminal 里(Windows 下可以使用 Xshell)
ssh [email protected]
登录后敲入passwd
,按照提示更改即可。
在 vultr 里更改
用 vultur console 更改 点击那个小小的终端符号(View Console),接着连到了登录界面,和上面一样敲入passwd
就能修改了
- 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.
还可以按照官方文档这样改,打开 console 后点击右上角的Ctrl+Alt+Del
,然后狂按键盘进入到一个选项页面,这个时候按下a
,接下来你应该会看到这样的提示符
然后直接在它末尾输入a single
后敲击回车 进入新的界面后和上面操作一样,输入passwd
……