linux + cant access as user + could not open session

7,535

An error message like "could not open session" is often the result from error in the authentication proces. In Linux is that the PAM stack, pluggable authentication Modules.

By default most distro's log authentication error messages in /var/log/secure. Start by checking there.

As discussed in chat: in this case the error originated from the pam_mkhomedir module that creates home directories for users when they log in for the first time and no home directory exists yet.

The base directory where the home directory is created must exist, in your case /Users/ but that single user that generates the error was incorrectly provisioned in the LDAP directory, with a home directory in /User/ missing the the plural s. Since that directory did not exist pam_mkhomedir failed and access was denied.

Solution: best is to correct the homeDirectory account property for that user in LDAP.
Work-around: simply create /User/.

Share:
7,535

Related videos on Youtube

maihabunash
Author by

maihabunash

I am 17 years old and love to develop

Updated on September 18, 2022

Comments

  • maihabunash
    maihabunash over 1 year

    in my Linux machine - red-hat

    I successfully to login to different users as the following

    su - userC
    [machine@Linux ~]$ pwd
    [machine@Linux ~]$ /Users/userC
    

    but only in one user I get the following

    su - UserA
    Creating directory '/User/UserA'.
    could not open session
    

    please advice from where I get the message "could not open session"

    what could be the problem ?

    • maihabunash
      maihabunash over 9 years
      hi your right - from the log I sow that /User dir is missing in spite all other users exist under /Users dir not /User
    • maihabunash
      maihabunash over 9 years
      but how it can be? why the log say that /User not exist while all other users are under /Users? , second I see that LDAP apears in the log - maybe we get wrong conf from LDAP ?
    • maihabunash
      maihabunash over 9 years
      but where is the wrong = User in where configuration file? ( is this info comes from the LDAP ? )