aeupinhere
aeupinhere

Reputation: 2983

could not open session as Root

I came across this error that is apparently pretty common among Linux Systems.

"Too many files Open"

In my code I tried to set the Python open file limit to unlimited and it threw an error saying that I could not exceed the system limit.

import resource

try:
    resource.setrlimit(resource.RLIMIT_NOFILE, (500,-1))
except Exception as err:
    print err
    pass

So...I Googled around a bit and followed this tutorial.

However, I set everything to 9999999 which I thought would be as close to unlimited as I could get. Now I cannot open a session as root on that machine. I can't login as root at all and am pretty much stuck. What can I do to get this machine working again? I need to be able to login as root! I am running Centos 6 and it's as up to date as possible.

Upvotes: 1

Views: 6000

Answers (2)

whoplisp
whoplisp

Reputation: 2518

Did you try turning it off and on?

If this doesn't help you can supply init=/bin/bash as kernel boot parameter to enter a root shell. Or boot from a live cd and revert your changes.

Upvotes: 2

SvenSsi
SvenSsi

Reputation: 1

After performing an 'strace su -', I looked for the 'No such file or directory' error. When comparing the output, I found that some of those errors are ok, however, there were other files missing on my problem system that existed on a comparison system. Ultimately, it led me to a faulty line in /etc/pam.d/system-auth-ac referencing an invalid shared object.

So, my recommendation is to go through your /etc/pam.d config files and validate the existence of the shared object libraries, or, look in /var/log/secure and it should give some clue to missing shared objects as well.

Upvotes: 0

Related Questions