Skip to content

Instantly share code, notes, and snippets.

@srimaln91
Created January 18, 2021 12:22
Show Gist options
  • Save srimaln91/dfffb69e6519ba35d9530987f65f832f to your computer and use it in GitHub Desktop.
Save srimaln91/dfffb69e6519ba35d9530987f65f832f to your computer and use it in GitHub Desktop.
ETCD User/Role Management Commands
ETCD User/Role Management Commands
# Users
etcdctl --endpoints {etcd_host}:2379 --user root --password {pass} user list
etcdctl --endpoints {etcd_host}:2379 --user root --password {pass} user add <user_name>
# Roles
etcdctl --endpoints {etcd_host}:2379 --user root --password {pass} role list
etcdctl --endpoints {etcd_host}:2379 --user root --password {pass} role add {role_name}
etcdctl --endpoints {etcd_host}:2379 --user root --password {pass} role grant-permission {role_name} --prefix=true read /system/delivery-services/
# Grant permissions to a role
etcdctl --endpoints {etcd_host}:2379 --user root --password {pass} role grant-permission {role_name} --prefix=true {read/write/readwrite} /system/delivery-services/
# Delete a role
etcdctl --endpoints {etcd_host}:2379 --user root --password {pass} role delete {role_name}
# Assign role to a user
etcdctl --endpoints {etcd_host}:2379 --user root --password {pass} user grant-role {user_name} {role_name}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment