README.turnadmin 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. GENERAL INFORMATION
  2. turnadmin is a TURN administration tool. This tool can be used to manage
  3. the user accounts (add/remove users, generate
  4. TURN keys for the users). For security reasons, we do not recommend
  5. storing passwords openly. The better option is to use pre-processed "keys"
  6. which are then used for authentication. These keys are generated by turnadmin.
  7. Turnadmin is a link to turnserver binary, but turnadmin performs different
  8. functions.
  9. Options note: turnadmin has long and short option names, for most options.
  10. Some options have only long form, some options have only short form. Their syntax
  11. somewhat different, if an argument is required:
  12. The short form must be used as this (for example):
  13. $ turnadmin -u <username> ...
  14. The long form equivalent must use the "=" character:
  15. $ turnadmin --user=<username> ...
  16. If this is a flag option (no argument required) then their usage are the same, for example:
  17. $ turnadmin -k ...
  18. is equivalent to:
  19. $ turnadmin --key ...
  20. You have always the use the -r <realm> option with commands for long term credentials -
  21. because data for multiple realms can be stored in the same database.
  22. =====================================
  23. NAME
  24. turnadmin - a TURN relay administration tool.
  25. SYNOPSIS
  26. $ turnadmin [command] [options]
  27. $ turnadmin [ -h | --help]
  28. DESCRIPTION
  29. Commands:
  30. -P, --generate-encrypted-password Generate and print to the standard
  31. output an encrypted form of a password (for web admin user or CLI).
  32. The value then can be used as a safe key for the password
  33. storage on disk or in the database. Every invocation for the same password
  34. produces a different result. The format of the encrypted password is:
  35. $5$<...salt...>$<...sha256(salt+password)...>. Salt is 16 characters,
  36. the sha256 output is 64 characters. Character 5 is the algorithm id (sha256).
  37. Only sha256 is supported as the hash function.
  38. -k, --key Generate key for a long-term credentials mechanism user.
  39. -a, --add Add or update a long-term user.
  40. -A, --add-admin Add or update an admin user.
  41. -d, --delete Delete a long-term user.
  42. -D, --delete-admin Delete an admin user.
  43. -l, --list List long-term users in the database.
  44. -L, --list-admin List admin users in the database.
  45. -s, --set-secret=<value> Add shared secret for TURN REST API
  46. -S, --show-secret Show stored shared secrets for TURN REST API
  47. -X, --delete-secret=<value> Delete a shared secret.
  48. --delete-all_secrets Delete all shared secrets for REST API.
  49. -O, --add-origin Add origin-to-realm relation.
  50. -R, --del-origin Delete origin-to-realm relation.
  51. -I, --list-origins List origin-to-realm relations.
  52. -g, --set-realm-option Set realm params: max-bps, total-quota, user-quota.
  53. -G, --list-realm-options List realm params.
  54. -E, --generate-encrypted-password-aes Generate and print to the standard output
  55. an encrypted form of password with AES-128
  56. Options with required values:
  57. -b, --db, --userdb SQLite user database file name (default - /var/db/turndb or
  58. /usr/local/var/db/turndb or /var/lib/turn/turndb).
  59. See the same option in the turnserver section.
  60. -e, --psql-userdb PostgreSQL user database connection string.
  61. See the --psql-userdb option in the turnserver section.
  62. -M, --mysql-userdb MySQL user database connection string.
  63. See the --mysql-userdb option in the turnserver section.
  64. -J, --mongo-userdb MongoDB user database connection string.
  65. See the --mysql-mongo option in the turnserver section.
  66. -N, --redis-userdb Redis user database connection string.
  67. See the --redis-userdb option in the turnserver section.
  68. -u, --user User name.
  69. -r, --realm Realm.
  70. -p, --password Password.
  71. -x, --key-path Generates a 128 bit key into the given path.
  72. -f, --file-key-path Contains a 128 bit key in the given path.
  73. -v, --verify Verify a given base64 encrypted type password.
  74. -o, --origin Origin
  75. --max-bps Set value of realm's max-bps parameter.
  76. --total-quota Set value of realm's total-quota parameter.
  77. --user-quota Set value of realm's user-quota parameter.
  78. -h, --help Help.
  79. Command examples:
  80. Generate an encrypted form of a password:
  81. $ turnadmin -P -p <password>
  82. Generate a key:
  83. $ turnadmin -k -u <username> -r <realm> -p <password>
  84. Add/update a user in the in the database:
  85. $ turnadmin -a [-b <userdb-file> | -e <db-connection-string> | -M <db-connection-string> | -N <db-connection-string> ] -u <username> -r <realm> -p <password>
  86. Delete a user from the database:
  87. $ turnadmin -d [-b <userdb-file> | -e <db-connection-string> | -M <db-connection-string> | -N <db-connection-string> ] -u <username> -r <realm>
  88. List all long-term users in MySQL database:
  89. $ turnadmin -l --mysql-userdb="<db-connection-string>" -r <realm>
  90. List all admin users in Redis database:
  91. $ turnadmin -L --redis-userdb="<db-connection-string>"
  92. Set secret in MySQL database:
  93. $ turnadmin -s <secret> --mysql-userdb="<db-connection-string>" -r <realm>
  94. Show secret stored in PostgreSQL database:
  95. $ turnadmin -S --psql-userdb="<db-connection-string>" -r <realm>
  96. Set origin-to-realm relation in MySQL database:
  97. $ turnadmin --mysql-userdb="<db-connection-string>" -r <realm> -o <origin>
  98. Delete origin-to-realm relation from Redis DB:
  99. $ turnadmin --redis-userdb="<db-connection-string>" -o <origin>
  100. List all origin-to-realm relations in Redis DB:
  101. $ turnadmin --redis-userdb="<db-connection-string>" -I
  102. List the origin-to-realm relations in PostgreSQL DB for a single realm:
  103. $ turnadmin --psql-userdb="<db-connection-string>" -I -r <realm>
  104. Create new key file for mysql password encryption:
  105. $ turnadmin -E --key-path <key-file>
  106. Create encrypted mysql password:
  107. $ turnadmin -E --file-key-path <key-file> -p <secret>
  108. Verify/decrypt encrypted password:
  109. $ turnadmin --file-key-path <key-file> -v <encrypted>
  110. Help:
  111. $ turnadmin -h
  112. =======================================
  113. DOCS
  114. After installation, run the command:
  115. $ man turnadmin
  116. or in the project root directory:
  117. $ man -M man turnadmin
  118. to see the man page.
  119. =====================================
  120. FILES
  121. /etc/turnserver.conf
  122. /var/db/turndb
  123. /usr/local/var/db/turndb
  124. /var/lib/turn/turndb
  125. /usr/local/etc/turnserver.conf
  126. =====================================
  127. DIRECTORIES
  128. /usr/local/share/turnserver
  129. /usr/local/share/doc/turnserver
  130. /usr/local/share/examples/turnserver
  131. ======================================
  132. SEE ALSO
  133. turnserver, turnutils
  134. ======================================
  135. WEB RESOURCES
  136. project page:
  137. https://github.com/coturn/coturn/
  138. Wiki page:
  139. https://github.com/coturn/coturn/wiki
  140. forum:
  141. https://groups.google.com/forum/?fromgroups=#!forum/turn-server-project-rfc5766-turn-server/
  142. ======================================
  143. AUTHORS
  144. See the AUTHORS.md file in the coturn source distribution.