A problem with Expect script LDAP password input

artadam

New Member
Joined
Sep 30, 2021
Messages
1
Reaction score
0
Credits
14
I have a problem with password input in ldapsearch command. I have script witch asks for LDAP password twice I have something like this except (expect_ldap.sh) script to enter LDAP password:

Bash:
#!/usr/bin/expect -d
    set timeout -1
    spawn sudo ./ldapu.sh
       
    expect "Enter LDAP Password:"
    sleep 1
    send "password\r"
   
    expect "Enter LDAP Password:"
    sleep 1
    send "password\r"
   
    expect eof

And it does not works with LDAP here is an output:

Bash:
 ldap_bind: Invalid credentials (49)

            additional info: 80090308: LdapErr: DSID-0C090400, comment: AcceptSecurityContext error, data 52e, v1db1

But when I run my ldapu.sh script and manually insert twice LDAP passwords all works fine.

Can anyone see the problem?
May be exists more correct way to solve this problem?

Thanks for your answers)
 
Last edited:

Staff online

Members online


Top