网易云服务器进入单用户模式设置方法

系统版本 centos 7.5

 

登陆管理平台的vnc界面,重启系统;然后执行以下操作:

1 - 在启动grub菜单,选择编辑选项启动就是按键盘e键,来进入编辑界面

2 - 找到Linux 16的那一行,将ro改为rw init=/sysroot/bin/sh   #如果进入不了系统,请删除 rhgb  quiet

  如果用的是kvm做了console连接授权,还要把授权的console=ttyS0去掉

3 - 现在按下 Control+x ,使用单用户模式启动  # windows 系统 curl + x

4 - 现在,可以使用下面的命令访问系统

chroot /sysroot

cp /etc/passwd- /etc/passwd

关闭selinux

vim /etc/sysconfig/selinux selinux = disabled

5 - 重置密码

passwd root

6 - 更新系统信息

touch /.autorelabel

7 - 退出chroot

exit

8 - 重启你的系统

reboot

 

参考资料:

  https://blog.csdn.net/mosicol/article/details/85078271

  https://blog.csdn.net/weixin_42747452/article/details/82655875

  https://blog.51cto.com/xiaocainiaox/2087673

posted on 2019-07-31 16:53  步留痕  阅读(406)  评论(0)    收藏  举报

导航