Root Login Permission Denied on CentOS7

A system that was a fresh installation of CentOS 7 Linux was just completed. After all the updates, the user began to install an application. After some time, the user logged out of the system and could not log back into it. As a root user, the administrator was unable to access the virtual machine even via console. This eliminated ssh and led to something bigger.

The issue was simple. The user added a couple of custom limits to the ulimits. Well, no limit at all, unlimited. These limits prevented even root logon.

Two part resolution. – After logging in via single user mode.

  • Commented out the offending lines so that the end user will start with more restrictive constraints.
  • Added the following line to the end of /etc/pam.d/login
session required

Restarted the server, and was able to logon.