All Products
Search
Document Center

:What do I do if I cannot log on to a Linux instance and the "login: Module is unknown" error is reported?

Last Updated:Feb 07, 2023

This topic describes the cause of the issue that a Linux instance cannot be connected and the "login: Module is unknown" error is reported, and provides the solution.

Problem description

A Linux instance cannot be connected and an error message similar to the following one appears in the secure log:

login: Module is unknown.
login: PAM unable to dlopen(/lib/security/pam_limits.so): /lib/security/pam_limits.so: cannot open shared object file: No such file or directory.

Cause

For each application that has Pluggable Authentication Modules (PAM) enabled, a configuration file that is named after the application exists in the /etc/pam.d directory. For example, if the configuration file of the login command is /etc/pam.d/login, you can configure a policy in the corresponding configuration file, as described in the following table.

File

Description

/etc/pam.d/login

The configuration file that corresponds to the console (management terminal).

/etc/pam.d/sshd

The configuration file that is used for instance logons.

/etc/pam.d/system-auth

The system global configuration file.

When you log on to the instance, some PAM-enabled applications fail to load modules. As a result, you cannot log on to the instance by using the applications. View the configurations of the /etc/pam.d/sshd file and /etc/pam.d/system-auth file. If an error occurs in the /etc/pam.d/login configuration file of the management terminal, submit a ticket to contact Alibaba Cloud technical support.

Solution

  1. Log on to the Linux instance by using a management terminal. For more information, see Connect to a Linux instance by using a password.

  2. Run the following command to view the PAM configuration file and check whether the configuration file contains the following configuration information.

    cat [$File_Name]
    Note

    [$File_Name] is the absolute path of the corresponding PAM configuration file.

    Configuration information: Cat

  3. Run the following command to check whether the pam_limits.so module file exists:

    Note

    In 64-bit Linux instances, the correct path is /lib64/security.

    ll /lib/security/pam_limits.so
  4. Run the following command to change the path of the pam_limits.so module to the correct path. Then, save the path and exit.

    vi [$File_Name]
    Note

    [$File_Name] is the absolute path of the corresponding PAM configuration file.

    Modified configuration:

    session    required     /lib64/security/pam_limits.so
  5. Log on to the Linux instance by using a management terminal. For more information, see Connect to a Linux instance by using a password.