当前位置:网站首页>Enable SASL authentication for memcached
Enable SASL authentication for memcached
2022-07-03 12:38:00 【Brother Xing plays with the clouds】
MemCached from 1.4.3 Version start , Can support SASL authentication . It is more suitable for multiple applications to share one MemCached colony , It needs to be done at compile time , add –enable-sasl Options .
start-up memcached when , increase -S The option to
“ ./configure –prefix=%{datadir} –enable-sasl
/usr/local/bin/memcached -S -d -u nobody ” SASL Authentication can also have many authentication mechanisms , such as pam,shadow,ldap etc.
The following is configured to use shadow How to authenticate
“ # modify /etc/sysconfig/saslauthd file
MECH=shadow
# Set the user's SASL The authentication code
saslpasswd2 -c -a memcached memuser
# Finally generated DB The file in /etc/ Next
-rw-r—– 1 root root 12288 Mar 6 11:52 /etc/sasldb2
# You can view the current SASL user
sasldblistusers2 ”
The following is configured to pass pam-mysql Use mysql Database to authenticate
“ # First installation pam-mysql
wget "http://prdownloads.sourceforge.net/pam-mysql/pam_mysql-0.7RC1.tar.gz"
./configure –with-mysql=/opt/apps_install/mysql-5.5.17
make & make install
# Add a soft link
ln -s /lib/security/pam_mysql.so /lib64/security/pam_mysql.so
# modify saslauthd To configure
MECH=pam
# edit pam.d Of memcached To configure
auth sufficient pam_mysql.so user=sasl passwd=saslpwd host=xxx db=dbname table=t_app_info usercolumn=appid passwdcolumn=secret crypt=0 sqllog=1 verbose=1
account required pam_mysql.so user=sasl passwd=saslpwd host=xxx db=dbname table=t_app_info usercolumn=appid passwdcolumn=secret crypt=0 sqllog=1 verbose=1
# New addition memcached Configuration file for /etc/sasl2/memcached.conf
pwcheck_method: saslauthd
# restart saslauthd
/etc/init.d/saslauthd restart
# test saslauthd Certification has been successful
/usr/sbin/testsaslauthd -s /etc/pam.d/memcached -u 10000 -p pwd
0: OK "Success." ”
memcached Of java client, Such as spymemcached and xmemcached They have already supported it SASL Certified
“ #xmemcached Certification examples
MemcachedClientBuilder builder = new XMemcachedClientBuilder(AddrUtil.getAddresses("10.x.xx.xx:11211"));
builder.addAuthInfo(AddrUtil.getOneAddress("10.x.xx.xx:11211"), AuthInfo.plain("10000", "pwd"));
builder.setCommandFactory(new BinaryCommandFactory());
client=builder.build();
String v = client.get("test2"); ” python Version of pylibmc Also support SASL authentication
边栏推荐
猜你喜欢

With pictures and texts, summarize the basic review of C language in detail, so that all kinds of knowledge points are clear at a glance?

剑指Offer10- I. 斐波那契数列

强大的头像制作神器微信小程序

剑指Offer03. 数组中重复的数字【简单】

【附下载】密码获取工具LaZagne安装及使用

Summary of development issues

Self made pop-up input box, input text, and click to complete the event.

Shutter widget: centerslice attribute

Pki/ca and digital certificate

LeetCode 0556. Next bigger element III - end of step 4
随机推荐
Is it safe to open an account for online stock speculation? Who can answer
Computer version wechat applet full screen display method, mobile phone horizontal screen method.
LeetCode 0556.下一个更大元素 III - 4步讲完
Lambda表达式
Everything comes to him who waits
Use Tencent cloud IOT platform to connect custom esp8266 IOT devices (realized by Tencent continuous control switch)
Display time with message interval of more than 1 minute in wechat applet discussion area
Sword finger offer04 Search in two-dimensional array [medium]
RedHat5 安装Socket5代理服务器
1-1 token
写一个简单的nodejs脚本
Nodejs+Express+MySQL实现登陆功能(含验证码)
Write a simple nodejs script
LeetCode 0556. Next bigger element III - end of step 4
wpa_ cli
Pki/ca and digital certificate
手机号码变成空号导致亚马逊账号登陆两步验证失败的恢复网址及方法
【嵌入式】---- 内存四区介绍
Togaf certification self-study classic v2.0
2.9 overview of databinding knowledge points