背景:操作系统:suse 11 4bit,同事搭建环境A,将原先现网的/etc/sysctl.conf拷贝打上,执行sysctl –p生效后,将A环境的/etc/security/limits.conf重名为.bak文件后,将现网/etc/security/limits.conf通过scp到A的时候报错
[root@station90 ~]# scp /etc/security/limits.conf [email protected]:/etc/security/
Password:
lost connection
rsync也同样报错
[root@station90 ~]# rsync /etc/security/limits.conf [email protected]:/etc/security/
Password:
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 254) at io.c(463) [sender=2.6.8]
[root@station90 ~]#
Sftp也同样报错,A环境没有安装vsftpd,即使安装了也没有用,默认root是不允许ftp的
[root@station90 ~]# sftp [email protected]
Connecting to 192.168.15.99...
Password:
Couldn't read packet: Connection reset by peer
同事遂重启了A系统,最大的败笔就在此了,进入运行级别3后,如下1所示
1、root登入系统,密码输入正确,报:Error in service module
2、由于同事做的操作记录了日志,当日志拿过来的时候,明显的原因就是mv /etc/security/limits.conf /etc/security/limitsconf.bak后,重启系统导致,但是现在无法进入系统
3、考虑单用户模式是否可以解决该问题,重启系统,在出现登入选项时,按ESC,在Boot Options的最后面加上single,回车,即可进入单用户模式,如下所示:
4、输入root密码,将文件重命名回来,init 3进入运行级别3即可正常登入了
5、大周末的出这种事情,周一到公司定要让那同事请吃饭去,哈哈,现在可以正常登入啦
6、如果没有limits.conf的备份文件,可以在目录下touch一个limits.conf,这样就可以登录进去了