2

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 2

3

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.

2
  • Curious. Will single-user mode ignore limits.conf? Commented Jul 22, 2016 at 23:00
  • 3
    Depends on how init system handles this. If it starts sulogin with ulimits from limits.conf then I think this is disastrous, but can be easily fixed with rebooting into plain single user with init=/bin/sh kernel parameter, which I always use. Then you will not be affected by bad limits.conf. Commented Jul 23, 2016 at 4:21
0

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"

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.