private static void resetAcls(final ZKWatcher zkw, final String znode, final boolean eraseAcls)
    throws Exception {
    List<String> children = ZKUtil.listChildrenNoWatch(zkw, znode);
    if (children != null) {
      for (String child : children) {
        resetAcls(zkw, ZNodePaths.joinZNode(znode, child), eraseAcls);
      }
    }

    ZooKeeper zk = zkw.getRecoverableZooKeeper().getZooKeeper();
    if (eraseAcls) {
      LOG.info(" - erase ACLs for {}", znode);
      zk.setACL(znode, ZooDefs.Ids.OPEN_ACL_UNSAFE, -1);
    } else {
      LOG.info(" - set ACLs for {}", znode);
      zk.setACL(znode, zkw.createACL(znode, true), -1);
    }
  }
You may add the jaas.conf option -Djava.security.auth.login.config=/PATH/jaas.conf You may also
specify -D to set options "hbase.zookeeper.quorum" (it should be in hbase-site.xml)
"zookeeper.znode.parent" (it should be in hbase-site.xml) Use -set-acls to set the ACLs, no
option to erase ACLs
hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKAclReset.java