如何通过 users.d 删除默认的 clickhouse 用户
How to remove the default clickhouse user through users.d
对于 clickhouse 生产服务器,我想通过定义的用户来保护访问,并删除默认用户。
我正在使用 users.d/myuser.xml 文件来添加新用户,我也想通过这种方式删除默认用户。
我找不到合适的组合。看起来我应该使用 "remove" 属性,但没有记录。
看来您需要进行以下更改:
/users.d/users.xml
<?xml version="1.0"?>
<yandex>
<users>
<default remove="remove">
</default>
<new_secured_user>
<password>hello_world</password>
<!-- More secure way to define password: -->
<!-- <password_sha256_hex>65e84be33532fb784c48129675f9eff3a682b27168c0ea744b2cf58ee02337c5</password_sha256_hex> -->
</new_secured_user>
</users>
</yandex>
看文章Remove/Replace config elements。
考虑到删除 default 用户需要对集群配置进行一些修改(参见 Access Rights):
The default user is chosen in cases when the username is not passed.
The default user is also used for distributed query processing, if the
configuration of the server or cluster doesn't specify the user and
password (see the section on the Distributed engine).
对于 clickhouse 生产服务器,我想通过定义的用户来保护访问,并删除默认用户。
我正在使用 users.d/myuser.xml 文件来添加新用户,我也想通过这种方式删除默认用户。
我找不到合适的组合。看起来我应该使用 "remove" 属性,但没有记录。
看来您需要进行以下更改:
/users.d/users.xml
<?xml version="1.0"?>
<yandex>
<users>
<default remove="remove">
</default>
<new_secured_user>
<password>hello_world</password>
<!-- More secure way to define password: -->
<!-- <password_sha256_hex>65e84be33532fb784c48129675f9eff3a682b27168c0ea744b2cf58ee02337c5</password_sha256_hex> -->
</new_secured_user>
</users>
</yandex>
看文章Remove/Replace config elements。
考虑到删除 default 用户需要对集群配置进行一些修改(参见 Access Rights):
The default user is chosen in cases when the username is not passed. The default user is also used for distributed query processing, if the configuration of the server or cluster doesn't specify the user and password (see the section on the Distributed engine).