etcdctl no password with CLI does not work #20159
-
Bug report criteria
What happened?I'm trying to use mTLS auth for etcd Step 1Here's how I start a ./bin/etcd \
--name etcd-node1 \
--listen-client-urls "https://127.0.0.1:2379/" \
--advertise-client-urls "https://127.0.0.1:2379/" \
--listen-peer-urls "http://127.0.0.1:2380/" \
--initial-advertise-peer-urls "http://127.0.0.1:2380/" \
--initial-cluster "etcd-node1=http://127.0.0.1:2380/" \
--cert-file "${SERVER_CERT}" \
--key-file "${SERVER_KEY}" \
--client-cert-auth \
--trusted-ca-file "${CA_CERT}" --log-level debug Step 2I created a passwordless user root
What did you expect to happen?To be able to perform passwordless operation. How can we reproduce it (as minimally and precisely as possible)?N/A Anything else we need to know?I can't perform any etcdctl ops because when Slack conversation: https://kubernetes.slack.com/archives/C3HD8ARJ5/p1748914427364059 Etcd version (please run commands below)$ ./etcd --version
etcd Version: 3.5.21
Git SHA: 960a0d374a
Go Version: go1.23.9
Go OS/Arch: darwin/arm64
$ ./etcdctl version
etcdctl version: 3.5.21
API version: 3.5 Etcd configuration (command line flags or environment variables)paste your configuration hereEtcd debug information (please run commands below, feel free to obfuscate the IP address or FQDN in the output)$ etcdctl member list -w table
# paste output here
$ etcdctl --endpoints=<member list> endpoint status -w table
# paste output here Relevant log output |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 12 replies
-
Note the passwordless users are for the TLS Common Name based authentication use case only. Refer to https://etcd.io/docs/v3.6/op-guide/authentication/rbac/#using-tls-common-name |
Beta Was this translation helpful? Give feedback.
-
@ahrtr sorry. Let me explain the scenario. Step 0: Start etcd server ./bin/etcd \
--name etcd-1 \
--data-dir /tmp/etcd-1 \
--listen-client-urls https://127.0.0.1:2379 \
--advertise-client-urls https://127.0.0.1:2379 \
--listen-peer-urls http://127.0.0.1:2380 \
--initial-advertise-peer-urls http://127.0.0.1:2380 \
--initial-cluster etcd-1=http://127.0.0.1:2380 \
--initial-cluster-token etcd-token \
--cert-file ${SERVER_CERT} \
--key-file ${SERVER_KEY} \
--trusted-ca-file ${CA_CERT} \
--client-cert-auth=true \
--auth-token=simple \
--client-cert-auth \
--log-level debug If you see I have Step 1: Setup auth, and create user1, and grant READWRITE permissions to that user for prefix # create root user
./bin/etcdctl --cacert="${CA_CERT}" --cert="${CLIENT_ROOT_CERT}" --key="${CLIENT_ROOT_KEY}" user add root --no-password
User root created
# grant role root to user root
./bin/etcdctl --cacert="${CA_CERT}" --cert="${CLIENT_ROOT_CERT}" --key="${CLIENT_ROOT_KEY}" user grant-role root root --user root
Password: <press return>
Role root is granted to user root
# enable auth
> ./bin/etcdctl --cacert=${CA_CERT} --cert ${CLIENT_ROOT_CERT} --key ${CLIENT_ROOT_KEY} auth enable --user root
Password: <press return>
Authentication Enabled
> ./bin/etcdctl --cacert=${CA_CERT} --cert ${CLIENT_ROOT_CERT} --key ${CLIENT_ROOT_KEY} user add user1
Password of user1: <type password>
Type password of user1 again for confirmation: <type password>
Password: <press return>
User user1 created
> ./bin/etcdctl --cacert=${CA_CERT} --cert ${CLIENT_ROOT_CERT} --key ${CLIENT_ROOT_KEY} role add user1
Role user1 created
> ./bin/etcdctl --cacert=${CA_CERT} --cert ${CLIENT_ROOT_CERT} --key ${CLIENT_ROOT_KEY} role grant-permission user1 READWRITE /user1/
Role user1 updated
> ./bin/etcdctl --cacert=${CA_CERT} --cert ${CLIENT_ROOT_CERT} --key ${CLIENT_ROOT_KEY} user grant-role user1 user1
Role user1 is granted to user user1 Step 2: Try using legacy auth mechanism after the cluster has transitioned to mTLS from simple token based auth. ./bin/etcdctl --cacert=${CA_CERT} --user user1 put /user1/test bar
Password: <type password> You see this on the server side {"level":"warn","ts":"2025-06-11T11:23:03.459915-0700","caller":"embed/config_logging.go:170","msg":"rejected connection on client endpoint","remote-addr":"127.0.0.1:49425","server-name":"","error":"tls: client didn't provide a certificate"} I have two questions
Thank you for taking the time to answer this. |
Beta Was this translation helpful? Give feedback.
-
@vivekpatani I was thinking the issue is related to passwordless user based on your original comment, but it seems that you do not mention it anymore. So the following comment is based on your latest comments. As mentioned in my previous comment #20159 (reply in thread), TLS/certificate is completely transportation layer authentication. Once you enable it, then the client must provide a valid certificate when talking to etcdserver. We don't have a plan to downgrade the level of security (i.e. allow users to specify a different policy such as Note that etcd auth is authorization, while TLS/certificate is authentication. They are different concepts, although there is overlap/relationship in etcd's implementation. Also AFAIK, all cloud provider should also enable For your case, one workaround that I can think of is to get the certificate configured for you clients first, then upgrade etcd cluster later. But you need to verify it . |
Beta Was this translation helpful? Give feedback.
We don't have such a plan. Also it isn't a priority for 3.7 either. Pls refer to https://github.com/etcd-io/etcd/blob/main/Documentation/contributor-guide/roadmap.md#v370
But it's open to discussion for future releases (i.e. 4.0).