当前位置:网站首页>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
边栏推荐
- Apache Mina Development Manual
- Shutter widget: centerslice attribute
- It feels great to know you learned something, isn‘t it?
- temp
- 雲計算未來 — 雲原生
- Kung Fu pays off, and learning is done
- 145. Post order traversal of binary tree
- Sword finger offer04 Search in two-dimensional array [medium]
- Flinksql can directly create tables and read MySQL or Kafka data on the client side, but how can it automatically flow and calculate?
- Dix règles de travail
猜你喜欢
【ManageEngine】IP地址扫描的作用
剑指Offer03. 数组中重复的数字【简单】
Prompt unread messages and quantity before opening chat group
剑指Offer04. 二维数组中的查找【中等】
The future of cloud computing cloud native
Idea packages the web project into a war package and deploys it to the server to run
使用BLoC 构建 Flutter的页面实例
阿里大于发送短信(用户微服务--消息微服务)
Integer int compare size
Shutter: overview of shutter architecture (excerpt)
随机推荐
Develop plug-ins for idea
Swift5.7 扩展 some 到泛型参数
If you can't learn, you have to learn. Jetpack compose writes an im app (I)
TOGAF认证自学宝典V2.0
十条职场规则
剑指Offer07. 重建二叉树
225. Implement stack with queue
Computer version wechat applet full screen display method, mobile phone horizontal screen method.
最新版抽奖盲盒运营版
Use Tencent cloud IOT platform to connect custom esp8266 IOT devices (realized by Tencent continuous control switch)
阿里大于发送短信(用户微服务--消息微服务)
Swagger
Dart: self study system
What is more elegant for flutter to log out and confirm again?
Flutter Widget : Flow
Shutter widget: centerslice attribute
Cloud Computing future - native Cloud
强大的头像制作神器微信小程序
Eureka self protection
Pytext training times error: typeerror:__ init__ () got an unexpected keyword argument 'serialized_ options'