users.xml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?xml version="1.0"?>
  2. <clickhouse>
  3. <!-- See also the files in users.d directory where the settings can be overridden. -->
  4. <!-- Profiles of settings. -->
  5. <profiles>
  6. <!-- Default settings. -->
  7. <default>
  8. </default>
  9. <!-- Profile that allows only read queries. -->
  10. <readonly>
  11. <readonly>1</readonly>
  12. </readonly>
  13. </profiles>
  14. <!-- Users and ACL. -->
  15. <users>
  16. <!-- If user name was not specified, 'default' user is used. -->
  17. <default>
  18. <!-- See also the files in users.d directory where the password can be overridden.
  19. Password could be specified in plaintext or in SHA256 (in hex format).
  20. If you want to specify password in plaintext (not recommended), place it in 'password' element.
  21. Example: <password>qwerty</password>.
  22. Password could be empty.
  23. If you want to specify SHA256, place it in 'password_sha256_hex' element.
  24. Example: <password_sha256_hex>65e84be33532fb784c48129675f9eff3a682b27168c0ea744b2cf58ee02337c5</password_sha256_hex>
  25. Restrictions of SHA256: impossibility to connect to ClickHouse using MySQL JS client (as of July 2019).
  26. If you want to specify double SHA1, place it in 'password_double_sha1_hex' element.
  27. Example: <password_double_sha1_hex>e395796d6546b1b65db9d665cd43f0e858dd4303</password_double_sha1_hex>
  28. If you want to specify a previously defined LDAP server (see 'ldap_servers' in the main config) for authentication,
  29. place its name in 'server' element inside 'ldap' element.
  30. Example: <ldap><server>my_ldap_server</server></ldap>
  31. If you want to authenticate the user via Kerberos (assuming Kerberos is enabled, see 'kerberos' in the main config),
  32. place 'kerberos' element instead of 'password' (and similar) elements.
  33. The name part of the canonical principal name of the initiator must match the user name for authentication to succeed.
  34. You can also place 'realm' element inside 'kerberos' element to further restrict authentication to only those requests
  35. whose initiator's realm matches it.
  36. Example: <kerberos />
  37. Example: <kerberos><realm>EXAMPLE.COM</realm></kerberos>
  38. How to generate decent password:
  39. Execute: PASSWORD=$(base64 < /dev/urandom | head -c8); echo "$PASSWORD"; echo -n "$PASSWORD" | sha256sum | tr -d '-'
  40. In first line will be password and in second - corresponding SHA256.
  41. How to generate double SHA1:
  42. Execute: PASSWORD=$(base64 < /dev/urandom | head -c8); echo "$PASSWORD"; echo -n "$PASSWORD" | sha1sum | tr -d '-' | xxd -r -p | sha1sum | tr -d '-'
  43. In first line will be password and in second - corresponding double SHA1.
  44. -->
  45. <password from_env="CLICKHOUSE_ADMIN_PASSWORD"/>
  46. <!-- List of networks with open access.
  47. To open access from everywhere, specify:
  48. <ip>::/0</ip>
  49. To open access only from localhost, specify:
  50. <ip>::1</ip>
  51. <ip>127.0.0.1</ip>
  52. Each element of list has one of the following forms:
  53. <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
  54. 2a02:6b8::3 or 2a02:6b8::3/64 or 2a02:6b8::3/ffff:ffff:ffff:ffff::.
  55. <host> Hostname. Example: server01.clickhouse.com.
  56. To check access, DNS query is performed, and all received addresses compared to peer address.
  57. <host_regexp> Regular expression for host names. Example, ^server\d\d-\d\d-\d\.clickhouse\.com$
  58. To check access, DNS PTR query is performed for peer address and then regexp is applied.
  59. Then, for result of PTR query, another DNS query is performed and all received addresses compared to peer address.
  60. Strongly recommended that regexp is ends with $
  61. All results of DNS requests are cached till server restart.
  62. -->
  63. <networks>
  64. <ip>::/0</ip>
  65. </networks>
  66. <!-- Settings profile for user. -->
  67. <profile>default</profile>
  68. <!-- Quota for user. -->
  69. <quota>default</quota>
  70. <!-- User can create other users and grant rights to them. -->
  71. <!-- <access_management>1</access_management> -->
  72. </default>
  73. </users>
  74. <!-- Quotas. -->
  75. <quotas>
  76. <!-- Name of quota. -->
  77. <default>
  78. <!-- Limits for time interval. You could specify many intervals with different limits. -->
  79. <interval>
  80. <!-- Length of interval. -->
  81. <duration>3600</duration>
  82. <!-- No limits. Just calculate resource usage for time interval. -->
  83. <queries>0</queries>
  84. <errors>0</errors>
  85. <result_rows>0</result_rows>
  86. <read_rows>0</read_rows>
  87. <execution_time>0</execution_time>
  88. </interval>
  89. </default>
  90. </quotas>
  91. </clickhouse>