Find the answer to your Linux question:
Results 1 to 3 of 3
Hello, All I want to do is: when user is logging in and the account exist in the system thats fine, everything should be as normal, but if the account ...
  1. #1
    Just Joined!
    Join Date
    Sep 2007
    Posts
    2

    LDAP login script

    Hello,

    All I want to do is: when user is logging in and the account exist in the system thats fine, everything should be as normal, but if the account doesn't exist I would like to check on ldap server if the user exists maybe using 'ldapserch -x -D ... -w password' command than parse the response, create his account using command adduser and log the user in. Is it possible? I tried to use LDAP authentication but unfortunately the server doesn't contains enough informations for poixAccout.

    Thanks for all responses.

  2. #2
    Just Joined! NightShade03's Avatar
    Join Date
    Apr 2010
    Location
    New York
    Posts
    18
    Quote Originally Posted by mmatras View Post
    Hello,

    All I want to do is: when user is logging in and the account exist in the system thats fine, everything should be as normal, but if the account doesn't exist I would like to check on ldap server if the user exists maybe using 'ldapserch -x -D ... -w password' command than parse the response, create his account using command adduser and log the user in. Is it possible? I tried to use LDAP authentication but unfortunately the server doesn't contains enough informations for poixAccout.

    Thanks for all responses.
    You can't change the way a login works. The script will only execute if user logins (due to them existing). If they don't exist you'd need to execute the script to create the user yourself. I'd also like to point out that this is a horribly insecure way of deal with new users as there is no policy in place to restrict anyone from creating their own account.

  3. #3
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    623
    Well, you can of course change the way a login works, with pam, but it doesn't work the way OP envisions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...