centos6、centos7更改root地址及修复

更改roor管理员UID为非零时,centos6、centos7无法正常启动。重启centos6、centos7时系统运行不一样。

一、Centos6

1、centos6用户root地址更改为2000,ctrl+x/y进行保存。

centos6、centos7更改root地址及修复_第1张图片

2、更改root用户(UID)地址为2000,进行保存。在SecureCRT上从新开启centos6端口,无法连接centos6。

centos6、centos7更改root地址及修复_第2张图片
SecureCRT开启centos6新端口。

3、在VMwere上切换centos6新端口时,用户无法登入。

centos6、centos7更改root地址及修复_第3张图片
VMwere切换centos6新的端口。

4、用户无法登入与链接,系统处于故障状态。重启VMwere上的centos6→快速点击A键,进入编辑界面。

centos6、centos7更改root地址及修复_第4张图片
编辑界面。

5、输入命令init=/bin/bash回车。

centos6、centos7更改root地址及修复_第5张图片
输入命令;init=/bin/bash。

6、输入命令mount -o remount,rw /  回车。

centos6、centos7更改root地址及修复_第6张图片
输入命令;mount -o remount,rw /。

7、输入命令nano /etc/passwd,更改root地址UID为0,ctrl+x/y进行保存。

centos6、centos7更改root地址及修复_第7张图片
输入命令;nano /etc/passwd。
centos6、centos7更改root地址及修复_第8张图片
更改root地址UID为0.

8、重新启动centos6.

centos6、centos7更改root地址及修复_第9张图片
重新启动完。

二、Centos7

1、centos7用户root地址更改为2000,ctrl+x/y进行保存。

centos6、centos7更改root地址及修复_第10张图片
更改root用户(UID)地址为2000,进行保存。

2、root用户无法登,系统处于故障状态。重启VMwere上的centos7→快速点击E键,进入编辑界面。

centos6、centos7更改root地址及修复_第11张图片
重新启动centos7.

3、输入命令init=/bin/bash、按ctrl+x键进行下一步。

centos6、centos7更改root地址及修复_第12张图片
输入命令;init=/bin/bash。

4、输入命令mount -o remount,rw /  回车。

centos6、centos7更改root地址及修复_第13张图片
输入命令;mount -o remount,rw /。

5、输入命令nano /etc/passwd。

centos6、centos7更改root地址及修复_第14张图片
输入命令;nano /etc/passwd。

6、更改root地址UID为0,ctrl+x/y进行保存。


centos6、centos7更改root地址及修复_第15张图片
更改root地址UID为0,进行保存。

7、重新启动centos7。

centos6、centos7更改root地址及修复_第16张图片
重新启动完成。


Centos6重新启动成功,修复完成。

你可能感兴趣的:(centos6、centos7更改root地址及修复)