zoukankan      html  css  js  c++  java
  • etcd 添加用户,授权特定目录

    适用场景

    多组共用etcd集群,创建一个新用户、新目录,让这个新用户只有新目录的使用权限。

    命令和顺序
    创建目录,注意此处是v2
    curl -u root:pwd  http://host:2379/v2/keys/dir -XPUT -d dir=true
    
    查看用户列表
    ./etcdctl -u root:pwd --endpoints=http://host:2379 user list
    
    添加用户
    ./etcdctl -u root:pwd --endpoints=http://host:2379 user list
    
    查看角色列表
    ./etcdctl -u root:pwd --endpoints=http://host:2379 role list
    
    添加角色
    ./etcdctl -u root:pwd --endpoints=http://host:2379 role add systech_nsq
    
    赋予角色指定目录权限
    ./etcdctl -u root:pwd --endpoints=http://host:2379 role grant systech_nsq -path '/b2c_systech_nsq/*' -readwrite
    
    查看角色权限
    ./etcdctl -u root:pwd --endpoints=http://host:2379 role get systech_nsq
    
    赋予用户角色
    ./etcdctl -u root:pwd --endpoints=http://host:2379 user grant systech_nsq -roles systech_nsq
    
  • 相关阅读:
    获取本地地址,获取上传文件的后缀
    foreach
    es6入门
    jquery-ui 拖拽排序
    移动端常用
    vue父子组件通信
    Weinre(pc调试手机页面)
    Ztree的使用
    jquery on() 转
    c++ 基本使用
  • 原文地址:https://www.cnblogs.com/mingbai/p/11728413.html
Copyright © 2011-2022 走看看