Re: Regarding setting up SASL with memcached server and getting a memcached client to associate with server.

2018-04-10 Thread Om Kale
Hi Dormando,
I finally figured it out the issue from the above thread itself.
The small change in steps as shown below work on my MAC machine:

OKALE-M-33H5:memcached-1.5.7 okale$ echo "testuser@OKALE-M-33H5:testpass" >
/tmp/memcached-sasl-db
OKALE-M-33H5:memcached-1.5.7 okale$ SASL_CONF_PATH="/Users/okale/sasl"
memcached -v -S
Reading configuration from: 
Initialized SASL.
mech:  ``PLAIN'' with 26 bytes of data
sasl result code:  0


Client Side:
OKALE-M-33H5:mycode okale$ ./testsasl testuser testpass 127.0.0.1
Get/Set success!

I observe two things here:
1. The saslpasswd2 doesn't create the memcached-sasl-db file for me, I
instead used the echo command listed above.
2. Now memcached appends mylocalhost-mac name i.e. @OKALE-M-33H5 to the
username when I run the client. (Not sure why this is the case)
It would be great if you could guide me as to whether there is a specific
reason to it and will I be able to perform the authentication without
saving the username in this format in my sasl db file.


Appreciate all the help!

Thanks and Regards,
Om Kale



On Tue, Apr 10, 2018 at 10:07 PM, Om Kale  wrote:

> Hi Dormando,
> Thanks for your guidance. Meanwhile, reading through the memcached email
> chain, I see someone else also observed something similar but there was no
> solution. The question is how do I create the memcahed-sasl-pwdb file and
> populate it with username and password as the saslpasswd2 doesnt seem to be
> doing it in this case.
>
> https://groups.google.com/d/msg/memcached/mtzcFVYahZo/ZGrX6i5FWsUJ
>
>
>
> Regards,
> Om Kale
>
>
>
>
> On Tuesday, April 10, 2018 at 7:07:58 PM UTC-7, Om Kale wrote:
>
>> Yes, that is correct. But if this change is done, then the entry in
>> memcached.conf for sasldb_path should also change to sasldb_path:
>> /tmp/memcached-sasl-pwdb.
>> However, if this change is made still it fails.
>>
>> OKALE-M-33H5:sasl okale$ cat memcached.conf
>> mech_list: plain
>> log_level: 5
>> sasldb_path: /tmp/memcached-sasl-pwdb
>> OKALE-M-33H5:sasl okale$ echo testpass | saslpasswd2 -f
>> /tmp/memcached-sasl-pwdb -a memcached -c -p testuser
>> OKALE-M-33H5:sasl okale$ SASL_CONF_PATH="/Users/okale/sasl" memcached -S
>> -v
>> Reading configuration from: 
>> Initialized SASL.
>> mech:  ``PLAIN'' with 26 bytes of data
>> WARNING: Failed to open sasl database : No such
>> file or directory
>> SASL (severity 2): Password verification failed
>> sasl result code:  -20
>> Unknown sasl response:  -20
>>
>>
>>
>> The problem is the saslpasswd2 command is not creating the file in the
>> desired location. I am not able to see memcached-sasl-pwdb under /tmp folder
>> OKALE-M-33H5:tmp okale$ ls -lrth
>> total 2920
>> drwxrwxrwx3 root   wheel96B Apr  4 14:42 boost_interprocess
>> drwx--3 okale  wheel96B Apr  4 14:43
>> com.apple.launchd.PJzhBv7YpC
>> drwx--3 okale  wheel96B Apr  4 14:43
>> com.apple.launchd.KfTcHnvIT3
>> drwx--3 okale  wheel96B Apr  4 14:43
>> com.apple.launchd.ha1KS1S42u
>> drwx--4 okale  wheel   128B Apr  6 15:44
>> com.apple.installermg8f7zLr
>> -rw-r--r--1 root   wheel   111B Apr  9 13:01 progress.log
>> drwx--2 okale  wheel64B Apr  9 13:53
>> KSDownloadAction.uWLwKCAAOF
>> drwx--2 okale  wheel64B Apr  9 13:53
>> KSOutOfProcessFetcher.3Esze3adI3
>> -rw-r--r--1 root   wheel   510B Apr 10 11:36 top.out
>> -rw-r--r--1 root   wheel 0B Apr 10 12:02 adobesmuoutpk1EMzc
>> -rw-r--r--1 root   wheel 0B Apr 10 12:02 adobesmuoutpmWzWeW
>> -rw-r--r--1 root   wheel 0B Apr 10 12:02 adobesmuoutpzm2q3Y
>> -rw-r--r--1 root   wheel 0B Apr 10 12:02 adobesmuoutpBo8m4d
>> -rw-rw-rw-@   1 okale  staff   1.0M Apr 10 16:12
>> libevent-2.1.8-stable.tar.gz
>> drwxr-xr-x@ 165 okale  wheel   5.2K Apr 10 16:19 libevent-2.1.8-stable
>> -rw-rw-rw-@   1 okale  staff   447K Apr 10 16:21 memcached-1.5.7.tar.gz
>> srwxr-xr-x1 okale  wheel 0B Apr 10 17:25 SIP-Main
>> srwxr-xr-x1 okale  wheel 0B Apr 10 17:25 SIP-MsgQ
>> drwxr-xr-x@ 148 okale  wheel   4.6K Apr 10 18:33 memcached-1.5.7
>> OKALE-M-33H5:tmp okale$
>>
>> Thanks and Regards,
>> Om Kale
>>
>>
>> On Tue, Apr 10, 2018 at 6:41 PM, dormando  wrote:
>>
>> Change:
>>
>> $ echo testpass | saslpasswd2 -f /Users/okale/sasl/memcached-sasl-pwdb -a
>> memcached -c -p testuser
>>
>> To:
>>
>> $ echo testpass | saslpasswd2 -f /tmp/memcached-sasl-pwdb -a
>> memcached -c -p testuser
>>
>> SASL_CONF_PATH points to where memcached.conf is. memcached.conf points to
>> memcached-sasl-pwdb via the sasldb_path: line.
>>
>> On Tue, 10 Apr 2018, Om Kale wrote:
>>
>> > Hi Dormando,
>> > Thanks for the help. I tried the steps you mentioned but end up getting
>> similar error. However, the error is slightly different this time.
>> > Why is it still pointing to '/tmp/memcached-sasl-db' when the
>> SASL_CONF_PATH specifies the location of the db file.
>> >
>> > OKALE-M-33H5:sasl okale$ pwd
>> > 

Re: Regarding setting up SASL with memcached server and getting a memcached client to associate with server.

2018-04-10 Thread dormando
Hey,

What is the exact output from saslpasswd2 when you run it?

On Tue, 10 Apr 2018, Om Kale wrote:

> Hi Dormando,
> Thanks for your guidance. Meanwhile, reading through the memcached email 
> chain, I see someone else also observed something similar but there was no
> solution. The question is how do I create the memcahed-sasl-pwdb file and 
> populate it with username and password as the saslpasswd2 doesnt seem to be
> doing it in this case.
>
> https://groups.google.com/d/msg/memcached/mtzcFVYahZo/ZGrX6i5FWsUJ
>
>
>
> Regards,
> Om Kale
>
>
>
> On Tuesday, April 10, 2018 at 7:07:58 PM UTC-7, Om Kale wrote:
>   Yes, that is correct. But if this change is done, then the entry in 
> memcached.conf for sasldb_path should also change to sasldb_path:
>   /tmp/memcached-sasl-pwdb.
> However, if this change is made still it fails.
>
> OKALE-M-33H5:sasl okale$ cat memcached.conf
> mech_list: plain
> log_level: 5
> sasldb_path: /tmp/memcached-sasl-pwdb
> OKALE-M-33H5:sasl okale$ echo testpass | saslpasswd2 -f 
> /tmp/memcached-sasl-pwdb -a memcached -c -p testuser
> OKALE-M-33H5:sasl okale$ SASL_CONF_PATH="/Users/okale/sasl" memcached -S -v
> Reading configuration from: 
> Initialized SASL.
> mech:  ``PLAIN'' with 26 bytes of data
> WARNING: Failed to open sasl database : No such file 
> or directory
> SASL (severity 2): Password verification failed
> sasl result code:  -20
> Unknown sasl response:  -20
>
>
>
> The problem is the saslpasswd2 command is not creating the file in the 
> desired location. I am not able to see memcached-sasl-pwdb under /tmp folder
> OKALE-M-33H5:tmp okale$ ls -lrth
> total 2920
> drwxrwxrwx    3 root   wheel    96B Apr  4 14:42 boost_interprocess
> drwx--    3 okale  wheel    96B Apr  4 14:43 com.apple.launchd.PJzhBv7YpC
> drwx--    3 okale  wheel    96B Apr  4 14:43 com.apple.launchd.KfTcHnvIT3
> drwx--    3 okale  wheel    96B Apr  4 14:43 com.apple.launchd.ha1KS1S42u
> drwx--    4 okale  wheel   128B Apr  6 15:44 com.apple.installermg8f7zLr
> -rw-r--r--    1 root   wheel   111B Apr  9 13:01 progress.log
> drwx--    2 okale  wheel    64B Apr  9 13:53 KSDownloadAction.uWLwKCAAOF
> drwx--    2 okale  wheel    64B Apr  9 13:53 
> KSOutOfProcessFetcher.3Esze3adI3
> -rw-r--r--    1 root   wheel   510B Apr 10 11:36 top.out
> -rw-r--r--    1 root   wheel 0B Apr 10 12:02 adobesmuoutpk1EMzc
> -rw-r--r--    1 root   wheel 0B Apr 10 12:02 adobesmuoutpmWzWeW
> -rw-r--r--    1 root   wheel 0B Apr 10 12:02 adobesmuoutpzm2q3Y
> -rw-r--r--    1 root   wheel 0B Apr 10 12:02 adobesmuoutpBo8m4d
> -rw-rw-rw-@   1 okale  staff   1.0M Apr 10 16:12 libevent-2.1.8-stable.tar.gz
> drwxr-xr-x@ 165 okale  wheel   5.2K Apr 10 16:19 libevent-2.1.8-stable
> -rw-rw-rw-@   1 okale  staff   447K Apr 10 16:21 memcached-1.5.7.tar.gz
> srwxr-xr-x    1 okale  wheel 0B Apr 10 17:25 SIP-Main
> srwxr-xr-x    1 okale  wheel 0B Apr 10 17:25 SIP-MsgQ
> drwxr-xr-x@ 148 okale  wheel   4.6K Apr 10 18:33 memcached-1.5.7
> OKALE-M-33H5:tmp okale$
>
> Thanks and Regards,Om Kale
>
>
> On Tue, Apr 10, 2018 at 6:41 PM, dormando  wrote:
>   Change:
>
>   $ echo testpass | saslpasswd2 -f /Users/okale/sasl/memcached-sasl-pwdb 
> -a
>   memcached -c -p testuser
>
>   To:
>
>   $ echo testpass | saslpasswd2 -f /tmp/memcached-sasl-pwdb -a
>   memcached -c -p testuser
>
>   SASL_CONF_PATH points to where memcached.conf is. memcached.conf points 
> to
>   memcached-sasl-pwdb via the sasldb_path: line.
>
>   On Tue, 10 Apr 2018, Om Kale wrote:
>
>   > Hi Dormando,
>   > Thanks for the help. I tried the steps you mentioned but end up 
> getting similar error. However, the error is slightly different this
>   time.
>   > Why is it still pointing to '/tmp/memcached-sasl-db' when the 
> SASL_CONF_PATH specifies the location of the db file.
>   >
>   > OKALE-M-33H5:sasl okale$ pwd
>   > /Users/okale/sasl
>   > OKALE-M-33H5:sasl okale$ cat memcached.conf
>   > mech_list: plain
>   > log_level: 5
>   > sasldb_path: /Users/okale/sasl/memcached-sasl-pwdb
>   > OKALE-M-33H5:sasl okale$ echo testpass | saslpasswd2 -f 
> /Users/okale/sasl/memcached-sasl-pwdb -a memcached -c -p testuser
>   > OKALE-M-33H5:sasl okale$ SASL_CONF_PATH="/Users/okale/sasl" memcached 
> -S -v
>   > Reading configuration from: 
>   > Initialized SASL.
>   > mech:  ``PLAIN'' with 26 bytes of data
>   > WARNING: Failed to open sasl database : No 
> such file or directory
>   > SASL (severity 2): Password verification failed
>   > sasl result code:  -20
>   > Unknown sasl response:  -20
>   > ^CSignal handled: Interrupt: 2.
>   > OKALE-M-33H5:sasl okale$
>   > OKALE-M-33H5:sasl okale$
>   > OKALE-M-33H5:sasl okale$
>   >
>   >
>   > On client side:
>   > OKALE-M-33H5:mycode okale$ ./testsasl testuser testpass 127.0.0.1
>   > Set failed: FAILED TO SEND 

Re: Regarding setting up SASL with memcached server and getting a memcached client to associate with server.

2018-04-10 Thread Om Kale
Hi Dormando,
Thanks for your guidance. Meanwhile, reading through the memcached email 
chain, I see someone else also observed something similar but there was no 
solution. The question is how do I create the memcahed-sasl-pwdb file and 
populate it with username and password as the saslpasswd2 doesnt seem to be 
doing it in this case.

https://groups.google.com/d/msg/memcached/mtzcFVYahZo/ZGrX6i5FWsUJ



Regards,
Om Kale



On Tuesday, April 10, 2018 at 7:07:58 PM UTC-7, Om Kale wrote:
>
> Yes, that is correct. But if this change is done, then the entry in 
> memcached.conf for sasldb_path should also change to sasldb_path: 
> /tmp/memcached-sasl-pwdb.
> However, if this change is made still it fails. 
>
> OKALE-M-33H5:sasl okale$ cat memcached.conf
> mech_list: plain
> log_level: 5
> sasldb_path: /tmp/memcached-sasl-pwdb
> OKALE-M-33H5:sasl okale$ echo testpass | saslpasswd2 -f 
> /tmp/memcached-sasl-pwdb -a memcached -c -p testuser
> OKALE-M-33H5:sasl okale$ SASL_CONF_PATH="/Users/okale/sasl" memcached -S -v
> Reading configuration from: 
> Initialized SASL.
> mech:  ``PLAIN'' with 26 bytes of data
> WARNING: Failed to open sasl database : No such 
> file or directory
> SASL (severity 2): Password verification failed
> sasl result code:  -20
> Unknown sasl response:  -20
>
>
>
> The problem is the saslpasswd2 command is not creating the file in the 
> desired location. I am not able to see memcached-sasl-pwdb under /tmp folder
> OKALE-M-33H5:tmp okale$ ls -lrth
> total 2920
> drwxrwxrwx3 root   wheel96B Apr  4 14:42 boost_interprocess
> drwx--3 okale  wheel96B Apr  4 14:43 
> com.apple.launchd.PJzhBv7YpC
> drwx--3 okale  wheel96B Apr  4 14:43 
> com.apple.launchd.KfTcHnvIT3
> drwx--3 okale  wheel96B Apr  4 14:43 
> com.apple.launchd.ha1KS1S42u
> drwx--4 okale  wheel   128B Apr  6 15:44 
> com.apple.installermg8f7zLr
> -rw-r--r--1 root   wheel   111B Apr  9 13:01 progress.log
> drwx--2 okale  wheel64B Apr  9 13:53 
> KSDownloadAction.uWLwKCAAOF
> drwx--2 okale  wheel64B Apr  9 13:53 
> KSOutOfProcessFetcher.3Esze3adI3
> -rw-r--r--1 root   wheel   510B Apr 10 11:36 top.out
> -rw-r--r--1 root   wheel 0B Apr 10 12:02 adobesmuoutpk1EMzc
> -rw-r--r--1 root   wheel 0B Apr 10 12:02 adobesmuoutpmWzWeW
> -rw-r--r--1 root   wheel 0B Apr 10 12:02 adobesmuoutpzm2q3Y
> -rw-r--r--1 root   wheel 0B Apr 10 12:02 adobesmuoutpBo8m4d
> -rw-rw-rw-@   1 okale  staff   1.0M Apr 10 16:12 
> libevent-2.1.8-stable.tar.gz
> drwxr-xr-x@ 165 okale  wheel   5.2K Apr 10 16:19 libevent-2.1.8-stable
> -rw-rw-rw-@   1 okale  staff   447K Apr 10 16:21 memcached-1.5.7.tar.gz
> srwxr-xr-x1 okale  wheel 0B Apr 10 17:25 SIP-Main
> srwxr-xr-x1 okale  wheel 0B Apr 10 17:25 SIP-MsgQ
> drwxr-xr-x@ 148 okale  wheel   4.6K Apr 10 18:33 memcached-1.5.7
> OKALE-M-33H5:tmp okale$
>
> Thanks and Regards,
> Om Kale
>
>
> On Tue, Apr 10, 2018 at 6:41 PM, dormando  wrote:
>
> Change:
>
> $ echo testpass | saslpasswd2 -f /Users/okale/sasl/memcached-sasl-pwdb -a
> memcached -c -p testuser
>
> To:
>
> $ echo testpass | saslpasswd2 -f /tmp/memcached-sasl-pwdb -a
> memcached -c -p testuser
>
> SASL_CONF_PATH points to where memcached.conf is. memcached.conf points to
> memcached-sasl-pwdb via the sasldb_path: line.
>
> On Tue, 10 Apr 2018, Om Kale wrote:
>
> > Hi Dormando,
> > Thanks for the help. I tried the steps you mentioned but end up getting 
> similar error. However, the error is slightly different this time.
> > Why is it still pointing to '/tmp/memcached-sasl-db' when the 
> SASL_CONF_PATH specifies the location of the db file.
> >
> > OKALE-M-33H5:sasl okale$ pwd
> > /Users/okale/sasl
> > OKALE-M-33H5:sasl okale$ cat memcached.conf
> > mech_list: plain
> > log_level: 5
> > sasldb_path: /Users/okale/sasl/memcached-sasl-pwdb
> > OKALE-M-33H5:sasl okale$ echo testpass | saslpasswd2 -f 
> /Users/okale/sasl/memcached-sasl-pwdb -a memcached -c -p testuser
> > OKALE-M-33H5:sasl okale$ SASL_CONF_PATH="/Users/okale/sasl" memcached -S 
> -v
> > Reading configuration from: 
> > Initialized SASL.
> > mech:  ``PLAIN'' with 26 bytes of data
> > WARNING: Failed to open sasl database : No such 
> file or directory
> > SASL (severity 2): Password verification failed
> > sasl result code:  -20
> > Unknown sasl response:  -20
> > ^CSignal handled: Interrupt: 2.
> > OKALE-M-33H5:sasl okale$
> > OKALE-M-33H5:sasl okale$
> > OKALE-M-33H5:sasl okale$
> >
> >
> > On client side:
> > OKALE-M-33H5:mycode okale$ ./testsasl testuser testpass 127.0.0.1
> > Set failed: FAILED TO SEND AUTHENTICATION TO SERVER
> > OKALE-M-33H5:mycode okale$ ./testsasl testuser testpass localhost
> > Set failed: AUTHENTICATION FAILURE
> > OKALE-M-33H5:mycode okale$
> >
> >
> > Any idea why?
> >
> >
> >
> > Thanks and Regards,Om Kale
> >
> > On Tue, Apr 10, 2018 at 4:38 PM, dormando  wrote:
> >   yes and yes.
> >
> >   

Re: Regarding setting up SASL with memcached server and getting a memcached client to associate with server.

2018-04-10 Thread dormando
Change:

$ echo testpass | saslpasswd2 -f /Users/okale/sasl/memcached-sasl-pwdb -a
memcached -c -p testuser

To:

$ echo testpass | saslpasswd2 -f /tmp/memcached-sasl-pwdb -a
memcached -c -p testuser

SASL_CONF_PATH points to where memcached.conf is. memcached.conf points to
memcached-sasl-pwdb via the sasldb_path: line.

On Tue, 10 Apr 2018, Om Kale wrote:

> Hi Dormando,
> Thanks for the help. I tried the steps you mentioned but end up getting 
> similar error. However, the error is slightly different this time.
> Why is it still pointing to '/tmp/memcached-sasl-db' when the SASL_CONF_PATH 
> specifies the location of the db file.
>
> OKALE-M-33H5:sasl okale$ pwd
> /Users/okale/sasl
> OKALE-M-33H5:sasl okale$ cat memcached.conf
> mech_list: plain
> log_level: 5
> sasldb_path: /Users/okale/sasl/memcached-sasl-pwdb
> OKALE-M-33H5:sasl okale$ echo testpass | saslpasswd2 -f 
> /Users/okale/sasl/memcached-sasl-pwdb -a memcached -c -p testuser
> OKALE-M-33H5:sasl okale$ SASL_CONF_PATH="/Users/okale/sasl" memcached -S -v
> Reading configuration from: 
> Initialized SASL.
> mech:  ``PLAIN'' with 26 bytes of data
> WARNING: Failed to open sasl database : No such file 
> or directory
> SASL (severity 2): Password verification failed
> sasl result code:  -20
> Unknown sasl response:  -20
> ^CSignal handled: Interrupt: 2.
> OKALE-M-33H5:sasl okale$
> OKALE-M-33H5:sasl okale$
> OKALE-M-33H5:sasl okale$
>
>
> On client side:
> OKALE-M-33H5:mycode okale$ ./testsasl testuser testpass 127.0.0.1
> Set failed: FAILED TO SEND AUTHENTICATION TO SERVER
> OKALE-M-33H5:mycode okale$ ./testsasl testuser testpass localhost
> Set failed: AUTHENTICATION FAILURE
> OKALE-M-33H5:mycode okale$
>
>
> Any idea why?
>
>
>
> Thanks and Regards,Om Kale
>
> On Tue, Apr 10, 2018 at 4:38 PM, dormando  wrote:
>   yes and yes.
>
>   mkdir sasl
>   cd sasl
>   then created memcached.conf
>   I did not create memcached-sasl-pwdb manually. saslpasswd2 made that for
>   me after I passed the -f argument.
>
>   On Tue, 10 Apr 2018, Om Kale wrote:
>
>   > Hi Dormando,
>   > Thanks for the update. I will try this out now. But before this I had 
> one more quick question.
>   > Did you create the sasl folder and memcached.conf manually inside 
> /home/dormando/ ?
>   >
>   >
>   > Thanks and Regards,Om Kale
>   >
>   >
>   > On Tue, Apr 10, 2018 at 3:38 PM, dormando  wrote:
>   >       Hey,
>   >
>   >       Was able to authenticate with your tool:
>   >
>   >       $ pwd
>   >       /home/dormando/sasl
>   >       $ cat memcached.conf
>   >       mech_list: plain
>   >       log_level: 5
>   >       sasldb_path: /home/dormando/sasl/memcached-sasl-pwdb
>   >       $ echo testpass | saslpasswd2 -f
>   >       /home/dormando/sasl/memcached-sasl-pwdb -a memcached -c -p 
> testuser
>   >       $ SASL_CONF_PATH="/home/dormando/sasl" memcached -S -v
>   >       INFO: MEMCACHED_SASL_PWDB not specified. Internal passwd 
> database disabled
>   >       Initialized SASL.
>   >       $ ./testsasl testuser testpass 127.0.0.1
>   >       Get/Set success!
>   >
>   >       Just add the "-f /path/to/sasl-pwdb" to saslpasswd2 and let it 
> create the
>   >       entry for you. Your manual passwd DB isn't valid.
>   >
>   >       Without the -f the tool was exiting with "Generic failure" 
> (should've
>   >       asked you what the exit code was earlier, sorry). Strace'ing it 
> showed it
>   >       was trying to open /etc/sasl and write a new file, but I wasn't 
> running as
>   >       root.
>   >
>   >       On Tue, 10 Apr 2018, Om Kale wrote:
>   >
>   >       > Hey Dormando,
>   >       > Today I tried reinstalling memcached from scratch and 
> followed the procedure in the wiki
>   >       > and the points you mentiibed however same issue of 'no secret 
> in database' is still
>   >       > observed.
>   >       >
>   >       > In addition, did the following steps but still no success.
>   >       > 
> https://stackoverflow.com/questions/12919032/can-i-set-username-and-password-on-memcach
>   >       > ed-like-mysql
>   >       >
>   >       >
>   >       > Thanks and Regards,Om Kale
>   >       >
>   >       > On Mon, Apr 9, 2018 at 11:58 PM, dormando 
>  wrote:
>   >       >       Sorry, ran out of time today. will try for earlier 
> tomorrow
>   >       >
>   >       >       On Mon, 9 Apr 2018, Om Kale wrote:
>   >       >
>   >       >       > Hi Dormando,I was just curious to know whether you 
> were able to reproduce
>   >       >       the above
>   >       >       > mentioned issue?
>   >       >       >
>   >       >       > Thanks and Regards,Om Kale
>   >       >       >
>   >       >       > On Mon, Apr 9, 2018 at 12:53 PM, 

Re: Regarding setting up SASL with memcached server and getting a memcached client to associate with server.

2018-04-10 Thread Om Kale
Hi Dormando,
Thanks for the help. I tried the steps you mentioned but end up getting
similar error. However, the error is slightly different this time.
Why is it still pointing to '/tmp/memcached-sasl-db' when the
SASL_CONF_PATH specifies the location of the db file.

OKALE-M-33H5:sasl okale$ pwd
/Users/okale/sasl
OKALE-M-33H5:sasl okale$ cat memcached.conf
mech_list: plain
log_level: 5
sasldb_path: /Users/okale/sasl/memcached-sasl-pwdb
OKALE-M-33H5:sasl okale$ echo testpass | saslpasswd2 -f
/Users/okale/sasl/memcached-sasl-pwdb -a memcached -c -p testuser
OKALE-M-33H5:sasl okale$ SASL_CONF_PATH="/Users/okale/sasl" memcached -S -v
Reading configuration from: 
Initialized SASL.
mech:  ``PLAIN'' with 26 bytes of data
WARNING: Failed to open sasl database : No such
file or directory
SASL (severity 2): Password verification failed
sasl result code:  -20
Unknown sasl response:  -20
^CSignal handled: Interrupt: 2.
OKALE-M-33H5:sasl okale$
OKALE-M-33H5:sasl okale$
OKALE-M-33H5:sasl okale$


On client side:
OKALE-M-33H5:mycode okale$ ./testsasl testuser testpass 127.0.0.1
Set failed: FAILED TO SEND AUTHENTICATION TO SERVER
OKALE-M-33H5:mycode okale$ ./testsasl testuser testpass localhost
Set failed: AUTHENTICATION FAILURE
OKALE-M-33H5:mycode okale$


Any idea why?



Thanks and Regards,
Om Kale

On Tue, Apr 10, 2018 at 4:38 PM, dormando  wrote:

> yes and yes.
>
> mkdir sasl
> cd sasl
> then created memcached.conf
> I did not create memcached-sasl-pwdb manually. saslpasswd2 made that for
> me after I passed the -f argument.
>
> On Tue, 10 Apr 2018, Om Kale wrote:
>
> > Hi Dormando,
> > Thanks for the update. I will try this out now. But before this I had
> one more quick question.
> > Did you create the sasl folder and memcached.conf manually inside
> /home/dormando/ ?
> >
> >
> > Thanks and Regards,Om Kale
> >
> >
> > On Tue, Apr 10, 2018 at 3:38 PM, dormando  wrote:
> >   Hey,
> >
> >   Was able to authenticate with your tool:
> >
> >   $ pwd
> >   /home/dormando/sasl
> >   $ cat memcached.conf
> >   mech_list: plain
> >   log_level: 5
> >   sasldb_path: /home/dormando/sasl/memcached-sasl-pwdb
> >   $ echo testpass | saslpasswd2 -f
> >   /home/dormando/sasl/memcached-sasl-pwdb -a memcached -c -p
> testuser
> >   $ SASL_CONF_PATH="/home/dormando/sasl" memcached -S -v
> >   INFO: MEMCACHED_SASL_PWDB not specified. Internal passwd database
> disabled
> >   Initialized SASL.
> >   $ ./testsasl testuser testpass 127.0.0.1
> >   Get/Set success!
> >
> >   Just add the "-f /path/to/sasl-pwdb" to saslpasswd2 and let it
> create the
> >   entry for you. Your manual passwd DB isn't valid.
> >
> >   Without the -f the tool was exiting with "Generic failure"
> (should've
> >   asked you what the exit code was earlier, sorry). Strace'ing it
> showed it
> >   was trying to open /etc/sasl and write a new file, but I wasn't
> running as
> >   root.
> >
> >   On Tue, 10 Apr 2018, Om Kale wrote:
> >
> >   > Hey Dormando,
> >   > Today I tried reinstalling memcached from scratch and followed
> the procedure in the wiki
> >   > and the points you mentiibed however same issue of 'no secret in
> database' is still
> >   > observed.
> >   >
> >   > In addition, did the following steps but still no success.
> >   > https://stackoverflow.com/questions/12919032/can-i-set-
> username-and-password-on-memcach
> >   > ed-like-mysql
> >   >
> >   >
> >   > Thanks and Regards,Om Kale
> >   >
> >   > On Mon, Apr 9, 2018 at 11:58 PM, dormando 
> wrote:
> >   >   Sorry, ran out of time today. will try for earlier tomorrow
> >   >
> >   >   On Mon, 9 Apr 2018, Om Kale wrote:
> >   >
> >   >   > Hi Dormando,I was just curious to know whether you were
> able to reproduce
> >   >   the above
> >   >   > mentioned issue?
> >   >   >
> >   >   > Thanks and Regards,Om Kale
> >   >   >
> >   >   > On Mon, Apr 9, 2018 at 12:53 PM, Om Kale <
> omkal...@gmail.com> wrote:
> >   >   >   Yes, that will be very helpful Dormando. I agree,
> might be missing
> >   >   >   something.
> >   >   > The points where I think I might be going wrong are as
> follows:
> >   >   >
> >   >   > 1. The exact location and contents of memcached.conf and
> the sasl db file
> >   >   -
> >   >   > memcached-sasl-pwdb (and the interaction between the
> two).
> >   >   > As per my understanding, SASL_CONF_PATH, tells the
> memcached server where
> >   >   to read
> >   >   > the file from and then the line sasldb_path in the conf
> file tells the
> >   >   server
> >   >   > where to get the sasl db file for username:password
> authentication. I feel
> >   >   this
> >   >   > linkage is 

Re: Regarding setting up SASL with memcached server and getting a memcached client to associate with server.

2018-04-10 Thread dormando
yes and yes.

mkdir sasl
cd sasl
then created memcached.conf
I did not create memcached-sasl-pwdb manually. saslpasswd2 made that for
me after I passed the -f argument.

On Tue, 10 Apr 2018, Om Kale wrote:

> Hi Dormando,
> Thanks for the update. I will try this out now. But before this I had one 
> more quick question.
> Did you create the sasl folder and memcached.conf manually inside 
> /home/dormando/ ?
>
>
> Thanks and Regards,Om Kale
>
>
> On Tue, Apr 10, 2018 at 3:38 PM, dormando  wrote:
>   Hey,
>
>   Was able to authenticate with your tool:
>
>   $ pwd
>   /home/dormando/sasl
>   $ cat memcached.conf
>   mech_list: plain
>   log_level: 5
>   sasldb_path: /home/dormando/sasl/memcached-sasl-pwdb
>   $ echo testpass | saslpasswd2 -f
>   /home/dormando/sasl/memcached-sasl-pwdb -a memcached -c -p testuser
>   $ SASL_CONF_PATH="/home/dormando/sasl" memcached -S -v
>   INFO: MEMCACHED_SASL_PWDB not specified. Internal passwd database 
> disabled
>   Initialized SASL.
>   $ ./testsasl testuser testpass 127.0.0.1
>   Get/Set success!
>
>   Just add the "-f /path/to/sasl-pwdb" to saslpasswd2 and let it create 
> the
>   entry for you. Your manual passwd DB isn't valid.
>
>   Without the -f the tool was exiting with "Generic failure" (should've
>   asked you what the exit code was earlier, sorry). Strace'ing it showed 
> it
>   was trying to open /etc/sasl and write a new file, but I wasn't running 
> as
>   root.
>
>   On Tue, 10 Apr 2018, Om Kale wrote:
>
>   > Hey Dormando,
>   > Today I tried reinstalling memcached from scratch and followed the 
> procedure in the wiki
>   > and the points you mentiibed however same issue of 'no secret in 
> database' is still
>   > observed.
>   >
>   > In addition, did the following steps but still no success.
>   > 
> https://stackoverflow.com/questions/12919032/can-i-set-username-and-password-on-memcach
>   > ed-like-mysql
>   >
>   >
>   > Thanks and Regards,Om Kale
>   >
>   > On Mon, Apr 9, 2018 at 11:58 PM, dormando  wrote:
>   >       Sorry, ran out of time today. will try for earlier tomorrow
>   >
>   >       On Mon, 9 Apr 2018, Om Kale wrote:
>   >
>   >       > Hi Dormando,I was just curious to know whether you were able 
> to reproduce
>   >       the above
>   >       > mentioned issue?
>   >       >
>   >       > Thanks and Regards,Om Kale
>   >       >
>   >       > On Mon, Apr 9, 2018 at 12:53 PM, Om Kale  
> wrote:
>   >       >       Yes, that will be very helpful Dormando. I agree, might 
> be missing
>   >       >       something.
>   >       > The points where I think I might be going wrong are as 
> follows:
>   >       >
>   >       > 1. The exact location and contents of memcached.conf and the 
> sasl db file
>   >       -
>   >       > memcached-sasl-pwdb (and the interaction between the two).
>   >       > As per my understanding, SASL_CONF_PATH, tells the memcached 
> server where
>   >       to read
>   >       > the file from and then the line sasldb_path in the conf file 
> tells the
>   >       server
>   >       > where to get the sasl db file for username:password 
> authentication. I feel
>   >       this
>   >       > linkage is not happening correctly in my case.
>   >       >
>   >       > 2. Is the sasl db file generated on its own when I run the 
> server? If yes,
>   >       do we
>   >       > need to add command line parameters while running the 
> memcached server for
>   >       this to
>   >       > happen. (FYI: I have configured --enable-sasl-pwdb while 
> running
>   >       configure)
>   >       >
>   >       > The main problem I am facing right now is memcached-sasl-pwdb 
> is not
>   >       getting
>   >       > created and populated on its own.
>   >       > Please do let me know the outcome once you try to reproduce 
> it. I am
>   >       cuurently
>   >       > using MAC-OS high Sierra.
>   >       >
>   >       > Thanks and Regards,Om Kale
>   >       >
>   >       >
>   >       > On Mon, Apr 9, 2018 at 12:28 PM, dormando 
>  wrote:
>   >       >       Hey,
>   >       >
>   >       >       I'll try to reproduce this today. I have a feeling 
> you're skipping
>   >       >       some
>   >       >       steps but it's definitely a confusing process...
>   >       >
>   >       >       On Mon, 9 Apr 2018, Om Kale wrote:
>   >       >
>   >       >       > Currently my set up is as follows:
>   >       >       > 1. My memcached.conf exists at
>   >       >       /Users/okale/Library/Caches/Homebrew/memcached-1.5.7/
>   >       >       > 2. The memcached server on starting reads 

Re: Regarding setting up SASL with memcached server and getting a memcached client to associate with server.

2018-04-10 Thread Om Kale
Hi Dormando,
Thanks for the update. I will try this out now. But before this I had one
more quick question.
Did you create the sasl folder and memcached.conf manually inside
/home/dormando/ ?


Thanks and Regards,
Om Kale


On Tue, Apr 10, 2018 at 3:38 PM, dormando  wrote:

> Hey,
>
> Was able to authenticate with your tool:
>
> $ pwd
> /home/dormando/sasl
> $ cat memcached.conf
> mech_list: plain
> log_level: 5
> sasldb_path: /home/dormando/sasl/memcached-sasl-pwdb
> $ echo testpass | saslpasswd2 -f
> /home/dormando/sasl/memcached-sasl-pwdb -a memcached -c -p testuser
> $ SASL_CONF_PATH="/home/dormando/sasl" memcached -S -v
> INFO: MEMCACHED_SASL_PWDB not specified. Internal passwd database disabled
> Initialized SASL.
> $ ./testsasl testuser testpass 127.0.0.1
> Get/Set success!
>
> Just add the "-f /path/to/sasl-pwdb" to saslpasswd2 and let it create the
> entry for you. Your manual passwd DB isn't valid.
>
> Without the -f the tool was exiting with "Generic failure" (should've
> asked you what the exit code was earlier, sorry). Strace'ing it showed it
> was trying to open /etc/sasl and write a new file, but I wasn't running as
> root.
>
> On Tue, 10 Apr 2018, Om Kale wrote:
>
> > Hey Dormando,
> > Today I tried reinstalling memcached from scratch and followed the
> procedure in the wiki
> > and the points you mentiibed however same issue of 'no secret in
> database' is still
> > observed.
> >
> > In addition, did the following steps but still no success.
> > https://stackoverflow.com/questions/12919032/can-i-set-
> username-and-password-on-memcach
> > ed-like-mysql
> >
> >
> > Thanks and Regards,Om Kale
> >
> > On Mon, Apr 9, 2018 at 11:58 PM, dormando  wrote:
> >   Sorry, ran out of time today. will try for earlier tomorrow
> >
> >   On Mon, 9 Apr 2018, Om Kale wrote:
> >
> >   > Hi Dormando,I was just curious to know whether you were able to
> reproduce
> >   the above
> >   > mentioned issue?
> >   >
> >   > Thanks and Regards,Om Kale
> >   >
> >   > On Mon, Apr 9, 2018 at 12:53 PM, Om Kale 
> wrote:
> >   >   Yes, that will be very helpful Dormando. I agree, might be
> missing
> >   >   something.
> >   > The points where I think I might be going wrong are as follows:
> >   >
> >   > 1. The exact location and contents of memcached.conf and the
> sasl db file
> >   -
> >   > memcached-sasl-pwdb (and the interaction between the two).
> >   > As per my understanding, SASL_CONF_PATH, tells the memcached
> server where
> >   to read
> >   > the file from and then the line sasldb_path in the conf file
> tells the
> >   server
> >   > where to get the sasl db file for username:password
> authentication. I feel
> >   this
> >   > linkage is not happening correctly in my case.
> >   >
> >   > 2. Is the sasl db file generated on its own when I run the
> server? If yes,
> >   do we
> >   > need to add command line parameters while running the memcached
> server for
> >   this to
> >   > happen. (FYI: I have configured --enable-sasl-pwdb while running
> >   configure)
> >   >
> >   > The main problem I am facing right now is memcached-sasl-pwdb is
> not
> >   getting
> >   > created and populated on its own.
> >   > Please do let me know the outcome once you try to reproduce it.
> I am
> >   cuurently
> >   > using MAC-OS high Sierra.
> >   >
> >   > Thanks and Regards,Om Kale
> >   >
> >   >
> >   > On Mon, Apr 9, 2018 at 12:28 PM, dormando 
> wrote:
> >   >   Hey,
> >   >
> >   >   I'll try to reproduce this today. I have a feeling you're
> skipping
> >   >   some
> >   >   steps but it's definitely a confusing process...
> >   >
> >   >   On Mon, 9 Apr 2018, Om Kale wrote:
> >   >
> >   >   > Currently my set up is as follows:
> >   >   > 1. My memcached.conf exists at
> >   >   /Users/okale/Library/Caches/Homebrew/memcached-1.5.7/
> >   >   > 2. The memcached server on starting reads from this file
> as shown
> >   in
> >   >   the log:
> >   >   > OKALE-M-33H5:memcached-1.5.7 okale$ ./memcached -S -v
> >   >   > Reading configuration from:
> >   >
> > memcached.conf>
> >   >   > Initialized SASL.
> >   >   > 3. The contents of the memcached.conf are:
> >   >   > mech_list: plain
> >   >   > log_level: 5
> >   >   > sasldb_path:
> >   >
> >/Users/okale/Library/Caches/Homebrew/memcached-1.5.7/
> memcached-sasl-pwdb
> >   >   > 4. The memcached-sasl-pwdb is located
> >   >   at /Users/okale/Library/Caches/Homebrew/memcached-1.5.7/
> and has the
> >   >   line:
> >   >   > (I am adding this line manually as the command 'echo
> "testpass" |
> >   >   

Re: Regarding setting up SASL with memcached server and getting a memcached client to associate with server.

2018-04-10 Thread dormando
Hey,

Was able to authenticate with your tool:

$ pwd
/home/dormando/sasl
$ cat memcached.conf
mech_list: plain
log_level: 5
sasldb_path: /home/dormando/sasl/memcached-sasl-pwdb
$ echo testpass | saslpasswd2 -f
/home/dormando/sasl/memcached-sasl-pwdb -a memcached -c -p testuser
$ SASL_CONF_PATH="/home/dormando/sasl" memcached -S -v
INFO: MEMCACHED_SASL_PWDB not specified. Internal passwd database disabled
Initialized SASL.
$ ./testsasl testuser testpass 127.0.0.1
Get/Set success!

Just add the "-f /path/to/sasl-pwdb" to saslpasswd2 and let it create the
entry for you. Your manual passwd DB isn't valid.

Without the -f the tool was exiting with "Generic failure" (should've
asked you what the exit code was earlier, sorry). Strace'ing it showed it
was trying to open /etc/sasl and write a new file, but I wasn't running as
root.

On Tue, 10 Apr 2018, Om Kale wrote:

> Hey Dormando,
> Today I tried reinstalling memcached from scratch and followed the procedure 
> in the wiki
> and the points you mentiibed however same issue of 'no secret in database' is 
> still
> observed.
>
> In addition, did the following steps but still no success.
> https://stackoverflow.com/questions/12919032/can-i-set-username-and-password-on-memcach
> ed-like-mysql
>
>
> Thanks and Regards,Om Kale
>
> On Mon, Apr 9, 2018 at 11:58 PM, dormando  wrote:
>   Sorry, ran out of time today. will try for earlier tomorrow
>
>   On Mon, 9 Apr 2018, Om Kale wrote:
>
>   > Hi Dormando,I was just curious to know whether you were able to 
> reproduce
>   the above
>   > mentioned issue?
>   >
>   > Thanks and Regards,Om Kale
>   >
>   > On Mon, Apr 9, 2018 at 12:53 PM, Om Kale  wrote:
>   >       Yes, that will be very helpful Dormando. I agree, might be 
> missing
>   >       something.
>   > The points where I think I might be going wrong are as follows:
>   >
>   > 1. The exact location and contents of memcached.conf and the sasl db 
> file
>   -
>   > memcached-sasl-pwdb (and the interaction between the two).
>   > As per my understanding, SASL_CONF_PATH, tells the memcached server 
> where
>   to read
>   > the file from and then the line sasldb_path in the conf file tells the
>   server
>   > where to get the sasl db file for username:password authentication. I 
> feel
>   this
>   > linkage is not happening correctly in my case.
>   >
>   > 2. Is the sasl db file generated on its own when I run the server? If 
> yes,
>   do we
>   > need to add command line parameters while running the memcached 
> server for
>   this to
>   > happen. (FYI: I have configured --enable-sasl-pwdb while running
>   configure)
>   >
>   > The main problem I am facing right now is memcached-sasl-pwdb is not
>   getting
>   > created and populated on its own.
>   > Please do let me know the outcome once you try to reproduce it. I am
>   cuurently
>   > using MAC-OS high Sierra.
>   >
>   > Thanks and Regards,Om Kale
>   >
>   >
>   > On Mon, Apr 9, 2018 at 12:28 PM, dormando  wrote:
>   >       Hey,
>   >
>   >       I'll try to reproduce this today. I have a feeling you're 
> skipping
>   >       some
>   >       steps but it's definitely a confusing process...
>   >
>   >       On Mon, 9 Apr 2018, Om Kale wrote:
>   >
>   >       > Currently my set up is as follows:
>   >       > 1. My memcached.conf exists at
>   >       /Users/okale/Library/Caches/Homebrew/memcached-1.5.7/
>   >       > 2. The memcached server on starting reads from this file as 
> shown
>   in
>   >       the log:
>   >       > OKALE-M-33H5:memcached-1.5.7 okale$ ./memcached -S -v
>   >       > Reading configuration from:
>   >     
>    
>   >       > Initialized SASL.
>   >       > 3. The contents of the memcached.conf are:
>   >       > mech_list: plain
>   >       > log_level: 5
>   >       > sasldb_path:
>   >     
>    
> /Users/okale/Library/Caches/Homebrew/memcached-1.5.7/memcached-sasl-pwdb
>   >       > 4. The memcached-sasl-pwdb is located
>   >       at /Users/okale/Library/Caches/Homebrew/memcached-1.5.7/ and 
> has the
>   >       line:
>   >       > (I am adding this line manually as the command 'echo 
> "testpass" |
>   >       saslpasswd2 -a memcached -c -p testuser' is not creating the 
> file
>   and
>   >       adding the
>   >       > content in it)
>   >       > ok:hello
>   >       >
>   >       > However, I still see same error on server side:
>   >       > mech:  ``SRP'' with 15 bytes of data
>   >       > SASL (severity 2): no secret in database
>   >       > sasl result code:  -4
>   >       > Unknown sasl response:  -4
>   >       >
>   >       > Also on client side, I still see:

Re: Regarding setting up SASL with memcached server and getting a memcached client to associate with server.

2018-04-10 Thread Om Kale
Hey Dormando,
Today I tried reinstalling memcached from scratch and followed the
procedure in the wiki and the points you mentiibed however same issue of
'no secret in database' is still observed.

In addition, did the following steps but still no success.
https://stackoverflow.com/questions/12919032/can-i-set-username-and-password-on-memcached-like-mysql


Thanks and Regards,
Om Kale

On Mon, Apr 9, 2018 at 11:58 PM, dormando  wrote:

> Sorry, ran out of time today. will try for earlier tomorrow
>
> On Mon, 9 Apr 2018, Om Kale wrote:
>
> > Hi Dormando,I was just curious to know whether you were able to
> reproduce the above
> > mentioned issue?
> >
> > Thanks and Regards,Om Kale
> >
> > On Mon, Apr 9, 2018 at 12:53 PM, Om Kale  wrote:
> >   Yes, that will be very helpful Dormando. I agree, might be missing
> >   something.
> > The points where I think I might be going wrong are as follows:
> >
> > 1. The exact location and contents of memcached.conf and the sasl db
> file -
> > memcached-sasl-pwdb (and the interaction between the two).
> > As per my understanding, SASL_CONF_PATH, tells the memcached server
> where to read
> > the file from and then the line sasldb_path in the conf file tells the
> server
> > where to get the sasl db file for username:password authentication. I
> feel this
> > linkage is not happening correctly in my case.
> >
> > 2. Is the sasl db file generated on its own when I run the server? If
> yes, do we
> > need to add command line parameters while running the memcached server
> for this to
> > happen. (FYI: I have configured --enable-sasl-pwdb while running
> configure)
> >
> > The main problem I am facing right now is memcached-sasl-pwdb is not
> getting
> > created and populated on its own.
> > Please do let me know the outcome once you try to reproduce it. I am
> cuurently
> > using MAC-OS high Sierra.
> >
> > Thanks and Regards,Om Kale
> >
> >
> > On Mon, Apr 9, 2018 at 12:28 PM, dormando  wrote:
> >   Hey,
> >
> >   I'll try to reproduce this today. I have a feeling you're skipping
> >   some
> >   steps but it's definitely a confusing process...
> >
> >   On Mon, 9 Apr 2018, Om Kale wrote:
> >
> >   > Currently my set up is as follows:
> >   > 1. My memcached.conf exists at
> >   /Users/okale/Library/Caches/Homebrew/memcached-1.5.7/
> >   > 2. The memcached server on starting reads from this file as
> shown in
> >   the log:
> >   > OKALE-M-33H5:memcached-1.5.7 okale$ ./memcached -S -v
> >   > Reading configuration from:
> >
>  
> >   > Initialized SASL.
> >   > 3. The contents of the memcached.conf are:
> >   > mech_list: plain
> >   > log_level: 5
> >   > sasldb_path:
> >
>  /Users/okale/Library/Caches/Homebrew/memcached-1.5.7/memcached-sasl-pwdb
> >   > 4. The memcached-sasl-pwdb is located
> >   at /Users/okale/Library/Caches/Homebrew/memcached-1.5.7/ and has
> the
> >   line:
> >   > (I am adding this line manually as the command 'echo "testpass" |
> >   saslpasswd2 -a memcached -c -p testuser' is not creating the file
> and
> >   adding the
> >   > content in it)
> >   > ok:hello
> >   >
> >   > However, I still see same error on server side:
> >   > mech:  ``SRP'' with 15 bytes of data
> >   > SASL (severity 2): no secret in database
> >   > sasl result code:  -4
> >   > Unknown sasl response:  -4
> >   >
> >   > Also on client side, I still see:
> >   > OKALE-M-33H5:mycode okale$ ./testsasl ok hello localhost
> >   > Set failed: AUTHENTICATION FAILURE
> >   >
> >   >
> >   > One more question is:
> >   > Is there any additional info to be provided while starting the
> >   memcached server itself?
> >   >
> > > Thanks and Regards,Om Kale
> > >
> > >
> > > On Mon, Apr 9, 2018 at 10:35 AM, Om Kale  wrote:
> > >   Hey Dormando,
> > > I do not see the memcached-sasl-pwdb created and the password added in
> it.
> > > The steps are same as above.
> > > Also, is there a specific location where memcached.conf and the sasl db
> > file: memcached-sasl-pwdb, need to be put?
> > > I do not see the memcached-sasl-pwdb created automatically. Also the
> > memcached.conf is located at t/sasl/memcached.conf, do I need to make the
> > > modification in this file to point to sasl db or can I create my own
> > memcached.conf at another location?
> > >
> > >
> > >
> > >
> > > Thanks and Regards,Om Kale
> > >
> > >
> > > On Fri, Apr 6, 2018 at 5:53 PM, dormando  wrote:
> > >   Hey,
> > >
> > >   Did the memcached-sasl-pwdb file get created and is there a line
> in
> > it?
> > >
> > >   On Fri, 6 Apr 2018, Om Kale wrote:
> > >
> > >   > Got it. I see the line you mentioned in the test code.
> > >   > I executed the following steps but still see same issue. (I ran
> > ./configure after the echo 

Re: Regarding setting up SASL with memcached server and getting a memcached client to associate with server.

2018-04-10 Thread dormando
Sorry, ran out of time today. will try for earlier tomorrow

On Mon, 9 Apr 2018, Om Kale wrote:

> Hi Dormando,I was just curious to know whether you were able to reproduce the 
> above
> mentioned issue?
>
> Thanks and Regards,Om Kale
>
> On Mon, Apr 9, 2018 at 12:53 PM, Om Kale  wrote:
>   Yes, that will be very helpful Dormando. I agree, might be missing
>   something.
> The points where I think I might be going wrong are as follows:
>
> 1. The exact location and contents of memcached.conf and the sasl db file -
> memcached-sasl-pwdb (and the interaction between the two).
> As per my understanding, SASL_CONF_PATH, tells the memcached server where to 
> read
> the file from and then the line sasldb_path in the conf file tells the server
> where to get the sasl db file for username:password authentication. I feel 
> this
> linkage is not happening correctly in my case.
>
> 2. Is the sasl db file generated on its own when I run the server? If yes, do 
> we
> need to add command line parameters while running the memcached server for 
> this to
> happen. (FYI: I have configured --enable-sasl-pwdb while running configure)
>
> The main problem I am facing right now is memcached-sasl-pwdb is not getting
> created and populated on its own.
> Please do let me know the outcome once you try to reproduce it. I am cuurently
> using MAC-OS high Sierra.
>
> Thanks and Regards,Om Kale
>
>
> On Mon, Apr 9, 2018 at 12:28 PM, dormando  wrote:
>   Hey,
>
>   I'll try to reproduce this today. I have a feeling you're skipping
>   some
>   steps but it's definitely a confusing process...
>
>   On Mon, 9 Apr 2018, Om Kale wrote:
>
>   > Currently my set up is as follows:
>   > 1. My memcached.conf exists at
>   /Users/okale/Library/Caches/Homebrew/memcached-1.5.7/
>   > 2. The memcached server on starting reads from this file as shown in
>   the log:
>   > OKALE-M-33H5:memcached-1.5.7 okale$ ./memcached -S -v
>   > Reading configuration from:
>   
>   > Initialized SASL.
>   > 3. The contents of the memcached.conf are:
>   > mech_list: plain
>   > log_level: 5
>   > sasldb_path:
>   /Users/okale/Library/Caches/Homebrew/memcached-1.5.7/memcached-sasl-pwdb
>   > 4. The memcached-sasl-pwdb is located
>   at /Users/okale/Library/Caches/Homebrew/memcached-1.5.7/ and has the
>   line:
>   > (I am adding this line manually as the command 'echo "testpass" |
>   saslpasswd2 -a memcached -c -p testuser' is not creating the file and
>   adding the
>   > content in it)
>   > ok:hello
>   >
>   > However, I still see same error on server side:
>   > mech:  ``SRP'' with 15 bytes of data
>   > SASL (severity 2): no secret in database
>   > sasl result code:  -4
>   > Unknown sasl response:  -4
>   >
>   > Also on client side, I still see:
>   > OKALE-M-33H5:mycode okale$ ./testsasl ok hello localhost
>   > Set failed: AUTHENTICATION FAILURE
>   >
>   >
>   > One more question is:
>   > Is there any additional info to be provided while starting the
>   memcached server itself?
>   >
> > Thanks and Regards,Om Kale
> >
> >
> > On Mon, Apr 9, 2018 at 10:35 AM, Om Kale  wrote:
> >       Hey Dormando,
> > I do not see the memcached-sasl-pwdb created and the password added in it.
> > The steps are same as above.
> > Also, is there a specific location where memcached.conf and the sasl db
> file: memcached-sasl-pwdb, need to be put?
> > I do not see the memcached-sasl-pwdb created automatically. Also the
> memcached.conf is located at t/sasl/memcached.conf, do I need to make the
> > modification in this file to point to sasl db or can I create my own
> memcached.conf at another location?
> >
> >
> >
> >
> > Thanks and Regards,Om Kale
> >
> >
> > On Fri, Apr 6, 2018 at 5:53 PM, dormando  wrote:
> >       Hey,
> >
> >       Did the memcached-sasl-pwdb file get created and is there a line in
> it?
> >
> >       On Fri, 6 Apr 2018, Om Kale wrote:
> >
> >       > Got it. I see the line you mentioned in the test code.
> >       > I executed the following steps but still see same issue. (I ran
> ./configure after the echo command)
> >       >
> >       >
> >       > Here are the steps:
> >       >
> >       > OKALE-M-33H5:memcached-1.5.7 okale$ echo "hello" | saslpasswd2 -a
> memcached -c -p ok
> >       > OKALE-M-33H5:memcached-1.5.7 okale$ ls -lrth | grep -i
> 'memcached.conf'
> >       > -rw-r--r--   1 okale  staff   116B Apr  6 15:28 memcached.conf
> >       > OKALE-M-33H5:memcached-1.5.7 okale$
> >       > OKALE-M-33H5:memcached-1.5.7 okale$
> >       > OKALE-M-33H5:memcached-1.5.7 okale$
> >       > OKALE-M-33H5:memcached-1.5.7 okale$ cat memcached.conf
> >       > mech_list: plain
> >       > log_level: 5
> >       > sasldb_path:
>