All Products
Search
Document Center

:What do I do if I cannot connect to a Linux instance and the "login: Module is unknown" error message appears?

Last Updated:Jun 28, 2024

This topic describes the cause of and solution to the following issue: You cannot connect to a Linux Elastic Compute Service (ECS) instance and the "login: Module is unknown" error message appears.

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 connect to the instance, some PAM-enabled applications fail to load modules. As a result, you cannot connect 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. Connect to the Linux instance by using a management terminal. For more information, see Connect to a Linux instance by using a username and 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:

  3. Cat

  4. 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
  5. 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
  6. Connect to the Linux instance by using a management terminal. For more information, see Connect to a Linux instance by using a username and password.