testaslauthdは成功しましたが、sasl-sample-server / clientは失敗しました。

testaslauthdは成功しましたが、sasl-sample-server / clientは失敗しました。

saslauthdXMPPサーバーを設定しようとしましたが、prosodyどこかで詰まっていました。私は次の文書を使用しました。

私の問題は接続できないことです。 XMPPクライアントは、認証情報を交換するときは常にどこかで停止します。

正常にテストされましたtestsaslauthd:

testsaslauthd -u theuser -p "$pw" 
0: OK "Success."

私はこれが/etc/saslauthd.confこの場合、ファイルが正しいことを意味すると思います。

/を使用してsasl-sample-serverテストしますsasl-sample-client(他の端末から呼び出して貼り付けS:C:行をコピー)。

root@xmpp:~# sasl-sample-server -s "xmpp" -m plain
Forcing use of mechanism plain
Sending list of 1 mechanism(s)
S: cGxhaW4=
Waiting for client mechanism...
C: U......................=
got 'PLAIN'
sasl-sample-server: SASL Other: Password verification failed
sasl-sample-server: Starting SASL negotiation: user not found (user not found)
<terminates>

root@xmpp:~# sasl-sample-client -s xmpp -a theuser 
service=xmpp
Waiting for mechanism list from server...
S: cGxhaW4=
recieved 5 byte message
Choosing best mechanism from: plain
returning OK: theuser
Password: 
Using mechanism PLAIN
Preparing initial.
Sending initial response...
C: U......................=
Negotiation complete
Username: theuser
SSF: 0
Waiting for encoded message...

testsaslauthd他のツールの組み合わせでユーザーを見つけることができないのに成功した理由を理解できません。

それを実行した後、私は/usr/sbin/saslauthd -dです/var/log/auth.log。おそらくそれが問題なのでしょう。しかし、どんなに努力しても間違った引数を提供する項目が見つかりません。

Dec  2 15:42:14 xmpp sasl-sample-server: auxpropfunc error invalid parameter supplied
Dec  2 15:42:14 xmpp sasl-sample-server: _sasl_plugin_load failed on sasl_auxprop_plug_init for plugin: ldapdb
Dec  2 15:42:14 xmpp sasl-sample-server: ldapdb_canonuser_plug_init() failed in sasl_canonuser_add_plugin(): invalid parameter supplied
Dec  2 15:42:14 xmpp sasl-sample-server: _sasl_plugin_load failed on sasl_canonuser_init for plugin: ldapdb
Dec  2 15:42:20 xmpp sasl-sample-client: ldapdb_canonuser_plug_init() failed in sasl_canonuser_add_plugin(): invalid parameter supplied
Dec  2 15:42:20 xmpp sasl-sample-client: _sasl_plugin_load failed on sasl_canonuser_init for plugin: ldapdb
Dec  2 15:42:34 xmpp sasl-sample-server: DIGEST-MD5 common mech free

また、オプションなしで複数のメソッドをsasl-sample-server使用するリストを見つけましたが、ファイルから明示的にメソッドを選択しました。sasl-sample-client-m/usr/lib/sasl2/xmpp.confPLAIN

pwcheck_method: saslauthd
mech_list: PLAIN

おそらくパスが間違っているので、ファイルをコピーしておく可能性があり/etc/sasl/xmpp.confます/etc/sasl2/xmpp.conf。残念ながら、Debian 8のパスを明確に説明するドキュメントが見つかりません。

さらに、testlauthdはサービスに興味がないようです。

root@xmpp:~# testsaslauthd -s xmpp -u theuser -p "$pw" 
0: OK "Success."
root@xmpp:~# testsaslauthd -s nonexistingservice -u theuser -p "$pw" 
0: OK "Success."

原因を見つけるために何ができるか知っていますか?

修正する:

明らかに、私はファイルアクセスがldapモードで行われるべきではないと思いますsasl-sample-server/etc/sasldb2このツールが設定に興味がなく、LDAPをサポートしていない可能性はありますか?トレースの出力:

stat("/etc/sasldb2", {st_mode=S_IFREG|0640, st_size=12288, ...}) = 0
open("/etc/sasldb2", O_RDONLY)          = 3
fcntl(3, F_GETFD)                       = 0
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
read(3, "\0\0\0\0\1\0\0\0\0\0\0\0a\25\6\0\t\0\0\0\0\20\0\0\0\10\0\0\0\0\0\0"..., 512) = 512
close(3)                                = 0

ベストアンサー1

解決策が見つかりました。

まず第一に:sasl-sample-serverLDAPはいかなる方法でもサポートされていないため、間違った方法で行っています。人間と会話しないようですが、saslauthd独自の実装があります。したがって、-a ldapoptionsを気にすることはできません/usr/sbin/saslauthd

それで韻で直接テストを始めました。ロギングをデバッグに設定した後、設定ファイルのすべてのパスがxmpp.conf正しくないことがわかりました。しかし、パスではありませんが、サービス名が変更されました。次のヒントが見つかりました。http://prosody.im/doc/cyrus_sasl:

LDAPに対して認証するためのProsodyの設定(ブログ投稿)

  • この投稿はxmpp.confを使用しますが、名前はprosody.confです(上記のcyrus_application_nameを参照)。

したがって、最終パスは/usr/lib/sasl2/prosody.conf(まだDebian 8)であり、内容はまだ同じです。

pwcheck_method: saslauthd
mech_list: PLAIN

この変更後、ついにxmppを使用してログインできました。

おすすめ記事