2016年9月22日 | Leave a comment 问题: CentOS 7 安装memcached 并配置密码 解决: 安装 memcached yum install memcached 1 yum install memcached 启动 systemctl start memcached 1 systemctl start memcached 启动 saslauthd ,默认是使用 pam 认证 systemctl start saslauthd 1 systemctl start saslauthd 添加用户memcacheuser1 useradd -M -s /bin/nologin memcacheuser1 #设置密码aaaaaa passwd memcacheuser1 123 useradd -M -s /bin/nologin memcacheuser1#设置密码aaaaaapasswd memcacheuser1 配置pam.d 增加 /etc/pam.d/memcached 内容为: #%PAM-1.0 auth include password-auth account include password-auth 123 #%PAM-1.0auth include password-authaccount include password-auth 测试 testsaslauthd -u memcacheuser1 -p aaaaaa -s memcached 1 testsaslauthd -u memcacheuser1 -p aaaaaa -s memcached 0: OK “Success.” 表示成功 配置memcache sasl 编辑文件 /etc/sasl2/memcached.conf pwcheck_method: saslauthd 1 pwcheck_method: saslauthd 参考: http://lguan.iteye.com/blog/1279537 http://www.lvtao.net/server/579.html http://www.51testing.com/html/28/116228-841656.html