After edited the /etc/security/limits.conf file to set the nofile parameter to unlimited, server got hanged . Can't login in via ssh. Tried to take console, issue with console. Will reboot of the VM will solve the login issue ?
2 Answers
Running ulimit -n unlimited as superuser on Linux says: Operation not permitted.
You need to boot into single user mode and fix your limits.conf back and specify some reasonable value, because Linux denies unlimited NOFILE.
-
Curious. Will single-user mode ignore
limits.conf?Chris Davies– Chris Davies2016-07-22 23:00:26 +00:00Commented Jul 22, 2016 at 23:00 -
3Depends on how init system handles this. If it starts
suloginwith ulimits fromlimits.confthen I think this is disastrous, but can be easily fixed with rebooting into plain single user withinit=/bin/shkernel parameter, which I always use. Then you will not be affected by badlimits.conf.user140866– user1408662016-07-23 04:21:16 +00:00Commented Jul 23, 2016 at 4:21
If you have a session open and are a wheel user you can use systemd-run to fix new session creation problems that stem from invalid configuration or excessive open file limits.
This worked for me even when pkexec su --session-command and many other attempts did not
For example:
systemd-run sh -c "cat fixed.conf > /etc/security/limits.conf"