1

I have PHP Memcached running I have binary turned on (both memcached process & php) I am using Memcached::setSaslAuthData Using Ubuntu 14.04

SASL is enabled I just continually get:

mech: ``PLAIN'' with 46 bytes of data SASL (severity 2): Password verification failed sasl result code: -20 Unknown sasl response: -20

From what I understand this means SASL_NO_USR I have created the user in sasldb2 The user running the memcached process has read/write permissions to /etc/sasldb2 When I run the sudo sasldblistusers2 -f /etc/sasldb2 command the user is listed.

Question: How do I properly troubleshoot/fix the password verification failure above.

Answer: Even with suggestions below I couldn't get this sorted. However I changed memcached to use a unix socket and modified the user permissions on the file.

# Run memcached as a daemon. This command is implied, and is not needed for the
# daemon to run. See the README.Debian that comes with this package for more
# information.
-d

#Start with sasl
#-S

# Log memcached's output to /var/log/memcached
logfile [location_of_log_file_here]

# Be verbose
-v

# Be even more verbose (print client commands as well)
#-vvvv

# Start with a cap of 64 megs of memory. It's reasonable, and the daemon default
# Note that the daemon will grow to this size, but does not start out holding this much
# memory
-m 128

# Run the daemon as root. The start-memcached will default to running as root if no
# -u command is present in this config file
-u [user_name_here]

# Specify which IP address to listen on. The default is to listen on all IP addresses
# This parameter is one of the only security measures that memcached has, so make sure
# it's listening on a firewalled interface.
# Default connection port is 11211
#-l $webServerIP
#-p $memcachedPort 
#-U 0

# Specify which socket to listen to and user permissions for that socket (more secure and faster)
-s /var/run/php/memcached.sock
-a 755
# Limit the number of simultaneous incoming connections. The daemon default is 1024
-c 1024

# Lock down all paged memory. Consult with the README and homepage before you do this
# -k

# Return error when memory is exhausted (rather than removing items)
# -M

# Maximize core file limit
# -r

-B binary
  • I have also ensured that the location of the sasldb file was added to the path and no go. Not sure what to try next. – Touch Cat Digital Inc. Oct 29 '14 at 01:47
  • 1
    Please make sure that the user listed by the sasldblistusers2 is exactly the same that you type. In my case it was appended with machine name. For example, I have set up a user called admin, but in sasldb it was present as admin@abc123144, which is the machine name. Please try this, this worked for me. – Aritra Chatterjee Mar 06 '19 at 16:09
  • Thanks @AritraChatterjee I tried several things to get it going. However in the end I used a socket instead of a port for memcached, and then set specific user permissions on that socket. – Touch Cat Digital Inc. May 15 '19 at 02:06

0 Answers0