You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Vikas Kumar <vi...@oracle.com> on 2021/01/21 00:23:06 UTC

Not able to authenticate using zk-shell

Hi,

I am trying to authenticate one of preexisting zknode path dns using digest method of zk-shell utility but I am not able to do so.
This is what I am doing:

Step 1: Generating the hashed password:

[root@control04 ~]#  java -cp "/usr/lib/zookeeper/zookeeper.jar:/usr/lib/zookeeper/lib/slf4j-api-1.6.1.jar" org.apache.zookeeper.server.auth.DigestAuthenticationProvider user:pass

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

SLF4J: Defaulting to no-operation (NOP) logger implementation

SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

user:pass->user:smGaoVKd/cQkjm7b88GyorAUz20=



Step 2: Tried set_acls:

[root@control04 ~]# zk-shell localhost:2181

Welcome to zk-shell (1.3.2)

(DISCONNECTED) />

(CONNECTED [localhost:2181]) /> cd /dns

(CONNECTED [localhost:2181]) /dns> ls

Not authenticated.

(CONNECTED [localhost:2181]) /dns> get_acls /dns

/dns: [ACL(perms=31, acl_list=['ALL'], id=Id(scheme=u'unix', id=u'admin')), ACL(perms=1, acl_list=['READ'], id=Id(scheme=u'unix', id=u'worker'))]

(CONNECTED [localhost:2181]) /dns> set_acls /dns 'world:anyone:r digest:user:smGaoVKd/cQkjm7b88GyorAUz20=:cdrwa'

Failed to set ACLs: [ACL(perms=1, acl_list=['READ'], id=Id(scheme='world', id='anyone')), ACL(perms=31, acl_list=['ALL'], id=Id(scheme='digest', id='user:smGaoVKd/cQkjm7b88GyorAUz20='))]. Error:

(CONNECTED [localhost:2181]) /dns> set_acls /dns 'world:anyone:r digest:user:smGaoVKd/cQkjm7b88GyorAUz20='

Failed to set ACLs: [ACL(perms=1, acl_list=['READ'], id=Id(scheme='world', id='anyone')), ACL(perms=29, acl_list=['READ', 'CREATE', 'DELETE', 'ADMIN'], id=Id(scheme='digest', id='user'))]. Error:



Step 3: Tried add_auth but didn’t help:

(CONNECTED [localhost:2181]) /dns> add_auth unix admin:<admin password>



Authentication failed.









Re: Not able to authenticate using zk-shell

Posted by Raúl Gutiérrez Segalés <rg...@itevenworks.net>.
Hi Vikas,

On Wed, Jan 20, 2021 at 7:25 PM Vikas Kumar <vi...@oracle.com>
wrote:

>
> Step 2: Tried set_acls:
>
> [root@control04 ~]# zk-shell localhost:2181
>
> Welcome to zk-shell (1.3.2)
>
> (DISCONNECTED) />
>
> (CONNECTED [localhost:2181]) /> cd /dns
>
> (CONNECTED [localhost:2181]) /dns> ls
>
> Not authenticated.
>
> (CONNECTED [localhost:2181]) /dns> get_acls /dns
>
> /dns: [ACL(perms=31, acl_list=['ALL'], id=Id(scheme=u'unix',
> id=u'admin')), ACL(perms=1, acl_list=['READ'], id=Id(scheme=u'unix',
> id=u'worker'))]
>
> (CONNECTED [localhost:2181]) /dns> set_acls /dns 'world:anyone:r
> digest:user:smGaoVKd/cQkjm7b88GyorAUz20=:cdrwa'
>
> Failed to set ACLs: [ACL(perms=1, acl_list=['READ'], id=Id(scheme='world',
> id='anyone')), ACL(perms=31, acl_list=['ALL'], id=Id(scheme='digest',
> id='user:smGaoVKd/cQkjm7b88GyorAUz20='))]. Error:
>
> (CONNECTED [localhost:2181]) /dns> set_acls /dns 'world:anyone:r
> digest:user:smGaoVKd/cQkjm7b88GyorAUz20='
>
> Failed to set ACLs: [ACL(perms=1, acl_list=['READ'], id=Id(scheme='world',
> id='anyone')), ACL(perms=29, acl_list=['READ', 'CREATE', 'DELETE',
> 'ADMIN'], id=Id(scheme='digest', id='user'))]. Error:
>
>
>
> Step 3: Tried add_auth but didn’t help:
>
> (CONNECTED [localhost:2181]) /dns> add_auth unix admin:<admin password>
>


[ Note that zk-shell is not part of the upstream project, so we can follow
offline in a github issue for the project ]

Did you pass the hashed admin password to add_auth?


-rgs