turnadmin.1 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. .\" Text automatically generated by txt2man
  2. .TH TURN 1 "05 June 2021" "" ""
  3. .SH GENERAL INFORMATION
  4. \fIturnadmin\fP is a TURN administration tool. This tool can be used to manage
  5. the user accounts (add/remove users, generate
  6. TURN keys for the users). For security reasons, we do not recommend
  7. storing passwords openly. The better option is to use pre\-processed "keys"
  8. which are then used for authentication. These keys are generated by \fIturnadmin\fP.
  9. Turnadmin is a link to \fIturnserver\fP binary, but \fIturnadmin\fP performs different
  10. functions.
  11. .PP
  12. Options note: \fIturnadmin\fP has long and short option names, for most options.
  13. Some options have only long form, some options have only short form. Their syntax
  14. somewhat different, if an argument is required:
  15. .PP
  16. The short form must be used as this (for example):
  17. .PP
  18. .nf
  19. .fam C
  20. $ turnadmin \-u <username> \.\.\.
  21. .fam T
  22. .fi
  23. The long form equivalent must use the "=" character:
  24. .PP
  25. .nf
  26. .fam C
  27. $ turnadmin \-\-user=<username> \.\.\.
  28. .fam T
  29. .fi
  30. If this is a flag option (no argument required) then their usage are the same, for example:
  31. .PP
  32. .nf
  33. .fam C
  34. $ turnadmin \-k \.\.\.
  35. .fam T
  36. .fi
  37. is equivalent to:
  38. .PP
  39. .nf
  40. .fam C
  41. $ turnadmin \-\-key \.\.\.
  42. .fam T
  43. .fi
  44. You have always the use the \fB\-r\fP <realm> option with commands for long term credentials \-
  45. because data for multiple realms can be stored in the same database.
  46. .SH =====================================
  47. .SS NAME
  48. \fB
  49. \fBturnadmin \fP\- a TURN relay administration tool.
  50. \fB
  51. .SS SYNOPSIS
  52. .nf
  53. .fam C
  54. $ \fIturnadmin\fP [\fIcommand\fP] [\fIoptions\fP]
  55. $ \fIturnadmin\fP [ \fB\-h\fP | \fB\-\-help\fP]
  56. .fam T
  57. .fi
  58. .fam T
  59. .fi
  60. .SS DESCRIPTION
  61. Commands:
  62. .TP
  63. .B
  64. \fB\-P\fP, \fB\-\-generate\-encrypted\-password\fP
  65. Generate and print to the standard
  66. output an encrypted form of a password (for web admin user or CLI).
  67. The value then can be used as a safe key for the password
  68. storage on disk or in the database. Every invocation for the same password
  69. produces a different result. The format of the encrypted password is:
  70. $5$<\.\.\.salt\.\.\.>$<\.\.\.sha256(salt+password)\.\.\.>. Salt is 16 characters,
  71. the sha256 output is 64 characters. Character 5 is the algorithm id (sha256).
  72. Only sha256 is supported as the hash function.
  73. .TP
  74. .B
  75. \fB\-k\fP, \fB\-\-key\fP
  76. Generate key for a long\-term credentials mechanism user.
  77. .TP
  78. .B
  79. \fB\-a\fP, \fB\-\-add\fP
  80. Add or update a long\-term user.
  81. .TP
  82. .B
  83. \fB\-A\fP, \fB\-\-add\-admin\fP
  84. Add or update an admin user.
  85. .TP
  86. .B
  87. \fB\-d\fP, \fB\-\-delete\fP
  88. Delete a long\-term user.
  89. .TP
  90. .B
  91. \fB\-D\fP, \fB\-\-delete\-admin\fP
  92. Delete an admin user.
  93. .TP
  94. .B
  95. \fB\-l\fP, \fB\-\-list\fP
  96. List long\-term users in the database.
  97. .TP
  98. .B
  99. \fB\-L\fP, \fB\-\-list\-admin\fP
  100. List admin users in the database.
  101. .PP
  102. \fB\-s\fP, \fB\-\-set\-secret\fP=<value> Add shared secret for TURN REST API
  103. .TP
  104. .B
  105. \fB\-S\fP, \fB\-\-show\-secret\fP
  106. Show stored shared secrets for TURN REST API
  107. .PP
  108. \fB\-X\fP, \fB\-\-delete\-secret\fP=<value> Delete a shared secret.
  109. .RS
  110. .TP
  111. .B
  112. \fB\-\-delete\-all_secrets\fP
  113. Delete all shared secrets for REST API.
  114. .RE
  115. .TP
  116. .B
  117. \fB\-O\fP, \fB\-\-add\-origin\fP
  118. Add origin\-to\-realm relation.
  119. .TP
  120. .B
  121. \fB\-R\fP, \fB\-\-del\-origin\fP
  122. Delete origin\-to\-realm relation.
  123. .TP
  124. .B
  125. \fB\-I\fP, \fB\-\-list\-origins\fP
  126. List origin\-to\-realm relations.
  127. .TP
  128. .B
  129. \fB\-g\fP, \fB\-\-set\-realm\-option\fP
  130. Set realm params: max\-bps, total\-quota, user\-quota.
  131. .TP
  132. .B
  133. \fB\-G\fP, \fB\-\-list\-realm\fP\-\fIoptions\fP
  134. List realm params.
  135. .TP
  136. .B
  137. \fB\-E\fP, \fB\-\-generate\-encrypted\-password\-aes\fP
  138. Generate and print to the standard output
  139. an encrypted form of password with AES\-128
  140. .PP
  141. Options with required values:
  142. .TP
  143. .B
  144. \fB\-b\fP, \fB\-\-db\fP, \fB\-\-userdb\fP
  145. SQLite user database file name (default \- /var/db/turndb or
  146. /usr/local/var/db/turndb or /var/lib/turn/turndb).
  147. See the same option in the \fIturnserver\fP section.
  148. .TP
  149. .B
  150. \fB\-e\fP, \fB\-\-psql\-userdb\fP
  151. PostgreSQL user database connection string.
  152. See the \fB\-\-psql\-userdb\fP option in the \fIturnserver\fP section.
  153. .TP
  154. .B
  155. \fB\-M\fP, \fB\-\-mysql\-userdb\fP
  156. MySQL user database connection string.
  157. See the \fB\-\-mysql\-userdb\fP option in the \fIturnserver\fP section.
  158. .TP
  159. .B
  160. \fB\-J\fP, \fB\-\-mongo\-userdb\fP
  161. MongoDB user database connection string.
  162. See the \fB\-\-mysql\-mongo\fP option in the \fIturnserver\fP section.
  163. .TP
  164. .B
  165. \fB\-N\fP, \fB\-\-redis\-userdb\fP
  166. Redis user database connection string.
  167. See the \fB\-\-redis\-userdb\fP option in the \fIturnserver\fP section.
  168. .TP
  169. .B
  170. \fB\-u\fP, \fB\-\-user\fP
  171. User name.
  172. .TP
  173. .B
  174. \fB\-r\fP, \fB\-\-realm\fP
  175. Realm.
  176. .TP
  177. .B
  178. \fB\-p\fP, \fB\-\-password\fP
  179. Password.
  180. .TP
  181. .B
  182. \fB\-x\fP, \fB\-\-key\-path\fP
  183. Generates a 128 bit key into the given path.
  184. .TP
  185. .B
  186. \fB\-f\fP, \fB\-\-file\-key\-path\fP
  187. Contains a 128 bit key in the given path.
  188. .TP
  189. .B
  190. \fB\-v\fP, \fB\-\-verify\fP
  191. Verify a given base64 encrypted type password.
  192. .TP
  193. .B
  194. \fB\-o\fP, \fB\-\-origin\fP
  195. Origin
  196. .TP
  197. .B
  198. \fB\-\-max\-bps\fP
  199. Set value of realm's max\-bps parameter.
  200. .TP
  201. .B
  202. \fB\-\-total\-quota\fP
  203. Set value of realm's total\-quota parameter.
  204. .TP
  205. .B
  206. \fB\-\-user\-quota\fP
  207. Set value of realm's user\-quota parameter.
  208. .TP
  209. .B
  210. \fB\-h\fP, \fB\-\-help\fP
  211. Help.
  212. .PP
  213. Command examples:
  214. .PP
  215. Generate an encrypted form of a password:
  216. .PP
  217. $ \fIturnadmin\fP \fB\-P\fP \fB\-p\fP <password>
  218. .PP
  219. Generate a key:
  220. .PP
  221. $ \fIturnadmin\fP \fB\-k\fP \fB\-u\fP <username> \fB\-r\fP <realm> \fB\-p\fP <password>
  222. .PP
  223. Add/update a user in the in the database:
  224. .PP
  225. $ \fIturnadmin\fP \fB\-a\fP [\fB\-b\fP <userdb\-file> | \fB\-e\fP <db\-connection\-string> | \fB\-M\fP <db\-connection\-string> | \fB\-N\fP <db\-connection\-string> ] \fB\-u\fP <username> \fB\-r\fP <realm> \fB\-p\fP <password>
  226. .PP
  227. Delete a user from the database:
  228. .PP
  229. $ \fIturnadmin\fP \fB\-d\fP [\fB\-b\fP <userdb\-file> | \fB\-e\fP <db\-connection\-string> | \fB\-M\fP <db\-connection\-string> | \fB\-N\fP <db\-connection\-string> ] \fB\-u\fP <username> \fB\-r\fP <realm>
  230. .PP
  231. List all long\-term users in MySQL database:
  232. .PP
  233. $ \fIturnadmin\fP \fB\-l\fP \fB\-\-mysql\-userdb\fP="<db\-connection\-string>" \fB\-r\fP <realm>
  234. .PP
  235. List all admin users in Redis database:
  236. .PP
  237. $ \fIturnadmin\fP \fB\-L\fP \fB\-\-redis\-userdb\fP="<db\-connection\-string>"
  238. .PP
  239. Set secret in MySQL database:
  240. .PP
  241. $ \fIturnadmin\fP \fB\-s\fP <secret> \fB\-\-mysql\-userdb\fP="<db\-connection\-string>" \fB\-r\fP <realm>
  242. .PP
  243. Show secret stored in PostgreSQL database:
  244. .PP
  245. $ \fIturnadmin\fP \fB\-S\fP \fB\-\-psql\-userdb\fP="<db\-connection\-string>" \fB\-r\fP <realm>
  246. .PP
  247. Set origin\-to\-realm relation in MySQL database:
  248. .PP
  249. $ \fIturnadmin\fP \fB\-\-mysql\-userdb\fP="<db\-connection\-string>" \fB\-r\fP <realm> \fB\-o\fP <origin>
  250. .PP
  251. Delete origin\-to\-realm relation from Redis DB:
  252. .PP
  253. $ \fIturnadmin\fP \fB\-\-redis\-userdb\fP="<db\-connection\-string>" \fB\-o\fP <origin>
  254. .PP
  255. List all origin\-to\-realm relations in Redis DB:
  256. .PP
  257. $ \fIturnadmin\fP \fB\-\-redis\-userdb\fP="<db\-connection\-string>" \fB\-I\fP
  258. .PP
  259. List the origin\-to\-realm relations in PostgreSQL DB for a single realm:
  260. .PP
  261. $ \fIturnadmin\fP \fB\-\-psql\-userdb\fP="<db\-connection\-string>" \fB\-I\fP \fB\-r\fP <realm>
  262. .PP
  263. Create new key file for mysql password encryption:
  264. .PP
  265. $ \fIturnadmin\fP \fB\-E\fP \fB\-\-key\-path\fP <key\-file>
  266. .PP
  267. Create encrypted mysql password:
  268. .PP
  269. $ \fIturnadmin\fP \fB\-E\fP \fB\-\-file\-key\-path\fP <key\-file> \fB\-p\fP <secret>
  270. .PP
  271. Verify/decrypt encrypted password:
  272. .PP
  273. $ \fIturnadmin\fP \fB\-\-file\-key\-path\fP <key\-file> \fB\-v\fP <encrypted>
  274. .RE
  275. .PP
  276. .RS
  277. Help:
  278. .PP
  279. $ \fIturnadmin\fP \fB\-h\fP
  280. .SH =======================================
  281. .SS DOCS
  282. After installation, run the \fIcommand\fP:
  283. .PP
  284. $ man \fIturnadmin\fP
  285. .PP
  286. or in the project root directory:
  287. .PP
  288. $ man \fB\-M\fP man \fIturnadmin\fP
  289. .PP
  290. to see the man page.
  291. .SH =====================================
  292. .SS FILES
  293. /etc/turnserver.conf
  294. .PP
  295. /var/db/turndb
  296. .PP
  297. /usr/local/var/db/turndb
  298. .PP
  299. /var/lib/turn/turndb
  300. .PP
  301. /usr/local/etc/turnserver.conf
  302. .SH =====================================
  303. .SS DIRECTORIES
  304. /usr/local/share/\fIturnserver\fP
  305. .PP
  306. /usr/local/share/doc/\fIturnserver\fP
  307. .PP
  308. /usr/local/share/examples/\fIturnserver\fP
  309. .SH ======================================
  310. .SS SEE ALSO
  311. \fIturnserver\fP, \fIturnutils\fP
  312. .SH ======================================
  313. .SS WEB RESOURCES
  314. project page:
  315. .PP
  316. https://github.com/coturn/coturn/
  317. .PP
  318. Wiki page:
  319. .PP
  320. https://github.com/coturn/coturn/wiki
  321. .PP
  322. forum:
  323. .PP
  324. https://groups.google.com/forum/?fromgroups=#!forum/turn\-server\-project\-rfc5766\-turn\-server/
  325. .SH ======================================
  326. .SS AUTHORS
  327. See the AUTHORS.md file in the coturn source distribution.