|
18 | 18 | <users> |
19 | 19 | <!-- If user name was not specified, 'default' user is used. --> |
20 | 20 | <default> |
21 | | - <!-- See also the files in users.d directory where the password can be overridden. |
22 | | -
|
23 | | - Password could be specified in plaintext or in SHA256 (in hex format). |
24 | | -
|
25 | | - If you want to specify password in plaintext (not recommended), place it in 'password' element. |
26 | | - Example: <password>qwerty</password>. |
27 | | - Password could be empty. |
28 | | -
|
29 | | - If you want to specify SHA256, place it in 'password_sha256_hex' element. |
30 | | - Example: <password_sha256_hex>65e84be33532fb784c48129675f9eff3a682b27168c0ea744b2cf58ee02337c5</password_sha256_hex> |
31 | | - Restrictions of SHA256: impossibility to connect to ClickHouse using MySQL JS client (as of July 2019). |
32 | | -
|
33 | | - If you want to specify double SHA1, place it in 'password_double_sha1_hex' element. |
34 | | - Example: <password_double_sha1_hex>e395796d6546b1b65db9d665cd43f0e858dd4303</password_double_sha1_hex> |
35 | | -
|
36 | | - If you want to specify a previously defined LDAP server (see 'ldap_servers' in the main config) for authentication, |
37 | | - place its name in 'server' element inside 'ldap' element. |
38 | | - Example: <ldap><server>my_ldap_server</server></ldap> |
39 | | -
|
40 | | - If you want to authenticate the user via Kerberos (assuming Kerberos is enabled, see 'kerberos' in the main config), |
41 | | - place 'kerberos' element instead of 'password' (and similar) elements. |
42 | | - The name part of the canonical principal name of the initiator must match the user name for authentication to succeed. |
43 | | - You can also place 'realm' element inside 'kerberos' element to further restrict authentication to only those requests |
44 | | - whose initiator's realm matches it. |
45 | | - Example: <kerberos /> |
46 | | - Example: <kerberos><realm>EXAMPLE.COM</realm></kerberos> |
47 | | -
|
48 | | - How to generate decent password: |
49 | | - Execute: PASSWORD=$(base64 < /dev/urandom | head -c8); echo "$PASSWORD"; echo -n "$PASSWORD" | sha256sum | tr -d '-' |
50 | | - In first line will be password and in second - corresponding SHA256. |
51 | | -
|
52 | | - How to generate double SHA1: |
53 | | - Execute: PASSWORD=$(base64 < /dev/urandom | head -c8); echo "$PASSWORD"; echo -n "$PASSWORD" | sha1sum | tr -d '-' | xxd -r -p | sha1sum | tr -d '-' |
54 | | - In first line will be password and in second - corresponding double SHA1. |
55 | | - --> |
56 | 21 | <password></password> |
57 | | - |
58 | | - <!-- List of networks with open access. |
59 | | -
|
60 | | - To open access from everywhere, specify: |
61 | | - <ip>::/0</ip> |
62 | | -
|
63 | | - To open access only from localhost, specify: |
64 | | - <ip>::1</ip> |
65 | | - <ip>127.0.0.1</ip> |
66 | | -
|
67 | | - Each element of list has one of the following forms: |
68 | | - <ip> IP-address or network mask. Examples: 213.180.204.3 or 10.0.0.1/8 or 10.0.0.1/255.255.255.0 |
69 | | - 2a02:6b8::3 or 2a02:6b8::3/64 or 2a02:6b8::3/ffff:ffff:ffff:ffff::. |
70 | | - <host> Hostname. Example: server01.clickhouse.com. |
71 | | - To check access, DNS query is performed, and all received addresses compared to peer address. |
72 | | - <host_regexp> Regular expression for host names. Example, ^server\d\d-\d\d-\d\.clickhouse\.com$ |
73 | | - To check access, DNS PTR query is performed for peer address and then regexp is applied. |
74 | | - Then, for result of PTR query, another DNS query is performed and all received addresses compared to peer address. |
75 | | - Strongly recommended that regexp is ends with $ |
76 | | - All results of DNS requests are cached till server restart. |
77 | | - --> |
78 | 22 | <networks> |
79 | 23 | <ip>::/0</ip> |
80 | 24 | </networks> |
|
96 | 40 | <query>GRANT ALL ON *.*</query> |
97 | 41 | </grants> |
98 | 42 | </default> |
| 43 | + |
| 44 | + <admin> |
| 45 | + <password>StrongPassword123</password> |
| 46 | + <networks> |
| 47 | + <ip>::/0</ip> |
| 48 | + </networks> |
| 49 | + <profile>default</profile> |
| 50 | + <quota>default</quota> |
| 51 | + <access_management>1</access_management> |
| 52 | + <named_collection_control>1</named_collection_control> |
| 53 | + <grants> |
| 54 | + <query>GRANT ALL ON *.* TO admin</query> |
| 55 | + </grants> |
| 56 | + </admin> |
| 57 | + |
99 | 58 | </users> |
100 | 59 |
|
101 | 60 | <!-- Quotas. --> |
|
0 commit comments