带有 SASL 的 Memcached:找不到 mech PLAIN

带有 SASL 的 Memcached:找不到 mech PLAIN

我正在尝试让 memcached 与 SASL 一起工作。我正在从源代码编译 memcached 和 libevent。

这些是我采取的步骤(在 root 和用户下,结果相同):

拥有这些包:

cyrus-sasl.x86_64               2.1.23-13.el6_3.1    @anaconda-CentOS-201303020151.x86_64/6.4
cyrus-sasl-devel.x86_64         2.1.23-13.el6_3.1    @cloudlinux-x86_64-server-6
cyrus-sasl-lib.x86_64           2.1.23-13.el6_3.1    @anaconda-CentOS-201303020151.x86_64/6.4

-

mkdir -p ~/working/sasl
nano ~/.bashrc

附加:

export PATH=$HOME/working/bin:$PATH
export LD_LIBRARY_PATH=:$HOME/working/lib:$HOME/working/include/:$LD_LIBRARY_PATH
export SASL_CONF_PATH=$HOME/working/sasl
export MEMCACHED_SASL_PWDB=$HOME/working/sasl/my.sasldb

-

. ~/.bashrc
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar zxvf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=$HOME/working
make
make install
cd ~
wget http://www.memcached.org/files/memcached-1.4.16.tar.gz
tar zxvf memcached-1.4.16.tar.gz
cd memcached-1.4.16
./configure --enable-sasl --enable-sasl-pwdb --prefix=$HOME/working
make
make install
saslpasswd2 -c -a memcached -f ~/working/sasl/my.sasldb mymemcached
nano ~/working/sasl/memcached.conf

插入:

mech_list: plain cram-md5
log_level: 5
sasldb_path: ~/working/sasl/my.sasldb

-

memcached -d -l 127.0.0.1 -p 11211 -m 64 -S -vvv -u root

现在我尝试登录(使用 php 脚本)

<26 server listening (binary)
<27 send buffer was 245760, now 268435456
<27 server listening (udp)
<27 server listening (udp)
<27 server listening (udp)
<27 server listening (udp)
<28 new binary client connection.
28: going from conn_new_cmd to conn_waiting
28: going from conn_waiting to conn_read
28: going from conn_read to conn_parse_cmd
<28 Read binary protocol data:
<28    0x80 0x21 0x00 0x05
<28    0x00 0x00 0x00 0x00
<28    0x00 0x00 0x00 0x17
<28    0x00 0x00 0x00 0x00
<28    0x00 0x00 0x00 0x00
<28    0x00 0x00 0x00 0x00
authenticated() in cmd 0x21 is true
28: going from conn_parse_cmd to conn_nread
mech:  ``PLAIN'' with 18 bytes of data
SASL (severity 2): Couldn't find mech PLAIN
sasl result code:  -4
Unknown sasl response:  -4
>28 Writing an error: Auth failure.
>28 Writing bin response:
>28   0x81 0x21 0x00 0x00
>28   0x00 0x00 0x00 0x20
>28   0x00 0x00 0x00 0x0d
>28   0x00 0x00 0x00 0x00
>28   0x00 0x00 0x00 0x00
>28   0x00 0x00 0x00 0x00
28: going from conn_nread to conn_mwrite
28: going from conn_mwrite to conn_new_cmd
28: going from conn_new_cmd to conn_waiting
28: going from conn_waiting to conn_read
28: going from conn_read to conn_closing
<28 connection closed.

我不知道哪里出了问题,也许我缺少一个库或一个 ENV 变量,或者我配置错误了某些东西。我不知道。

我需要将所有内容保留在 ~/working 中,是因为我想在 CloudLinux CageFS 下使用它,用户拥有一个完全工作的环境,但无法更改 /usr/ 目录等中的任何内容。因此所有内容都需要保留在他们的家庭用户中。但我也无法让它在 root 下工作。

答案1

我遇到了同样的问题。

使用多个选项进行调试后,通过安装以下包解决了该问题。

cyrus-sasl-plain

sudo yum install cyrus-sasl-plain 

发布此消息后,它开始正常工作。

答案2

cyrus-sasl-plain 应该安装在两个都如果你想让 PLAIN mech 工作,则客户端和服务器端

相关内容