遇到问题:修改vi /etc/security/limits.conf参数后,系统无法登录
* soft nofile unlimited
* hard nofile unlimited
原因:* soft nofile和* hard nofile两个参数最大值为1000000,如果大于1000000,会导致系统无法登录
解决办法:进入单用户模式,进行操作
1、重启系统,在系统启动界面中选择对应的内核,按"e"进入修改界面
2、进入修改界面后找到linux16这行,在此行的结尾添加 rd.break
3、按Ctrl+x 执行启动操作
4、mount -o remount,rw /sysroot/ #读写权限挂载根目录
5、chroot /sysroot/ #切回系统
6、vi /etc/security/limits.conf #编辑修改,删掉最后的这几行参数
* soft nofile
* hard nofile
:wq! #保存退出
7、exec /sbin/init #退出
8、reboot #重启
9、已经可以正常登录系统了
至此,CentOS-7.x进入单用户模式修改系统内核参数完成。

» 转载请注明来源:系统运维 » CentOS-7.x进入单用户模式修改系统内核参数


