secstore 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. .TH SECSTORE 1
  2. .SH NAME
  3. aescbc, secstore, ipso \- secstore commands
  4. .SH SYNOPSIS
  5. .B auth/secstore
  6. [
  7. .B -s
  8. .I server
  9. ]
  10. [
  11. .B -(g|G)
  12. .I getfile
  13. ]
  14. [
  15. .B -p
  16. .I putfile
  17. ]
  18. [
  19. .B -r
  20. .I rmfile
  21. ]
  22. [
  23. .B -c
  24. ]
  25. [
  26. .B -u
  27. .I user
  28. ]
  29. [
  30. .B -v
  31. ]
  32. [
  33. .B -i
  34. ]
  35. .PP
  36. .B auth/aescbc
  37. -e
  38. .I <cleartext
  39. .I >ciphertext
  40. .br
  41. .B auth/aescbc
  42. -d
  43. .I <ciphertext
  44. .I >cleartext
  45. .PP
  46. .B ipso
  47. [
  48. .B -a -e -l -f -s
  49. ] [
  50. .I file
  51. \&...
  52. ]
  53. .PP
  54. .SH DESCRIPTION
  55. .PP
  56. .I Secstore
  57. authenticates to the server
  58. using a password and optionally a hardware token,
  59. then saves or retrieves a file.
  60. This is intended to be a credentials store (public/private keypairs,
  61. passwords, and other secrets) for a factotum.
  62. .PP
  63. Option
  64. .B -p
  65. stores a file on the secstore.
  66. .PP
  67. Option
  68. .B -g
  69. retrieves a file to the local directory;
  70. option
  71. .B -G
  72. writes it to standard output instead.
  73. Specifying
  74. .I getfile
  75. of . will send to standard output
  76. a list of remote files with dates, lengths and SHA1 hashes.
  77. .PP
  78. Option
  79. .B -r
  80. removes a file from the secstore.
  81. .PP
  82. Option
  83. .B -c
  84. prompts for a password change.
  85. .PP
  86. Option
  87. .B -v
  88. produces more verbose output, in particular providing a few
  89. bits of feedback to help the user detect mistyping.
  90. .PP
  91. Option
  92. .B -i
  93. says that the password should be read from standard input
  94. instead of from
  95. .BR /dev/cons .
  96. .PP
  97. Option
  98. .B -n
  99. says that the password should be read from NVRAM
  100. (see
  101. .IR authsrv (2))
  102. instead of from
  103. .BR /dev/cons .
  104. .PP
  105. The server is
  106. .BR tcp!$auth!5356 ,
  107. or the server specified by option
  108. .BR -s .
  109. .PP
  110. For example, to add a secret to the file read by
  111. .IR factotum (4)
  112. at startup, open a new window, type
  113. .sp
  114. .EX
  115. % ramfs -p; cd /tmp
  116. % auth/secstore -g factotum
  117. secstore password:
  118. % echo 'key proto=apop dom=x.com user=ehg !password=hi' >> factotum
  119. % auth/secstore -p factotum
  120. secstore password:
  121. % read -m factotum > /mnt/factotum/ctl
  122. .EE
  123. .PP
  124. and delete the window.
  125. The first line creates an ephemeral memory-resident workspace,
  126. invisible to others and automatically removed when the window is deleted.
  127. The next three commands fetch the persistent copy of the secrets,
  128. append a new secret,
  129. and save the updated file back to secstore.
  130. The final command loads the new secret into the running factotum.
  131. .PP
  132. The
  133. .I ipso
  134. command packages this sequence into a convenient script to simplify editing of
  135. .I files
  136. stored on a secure store.
  137. It copies the named
  138. .I files
  139. into a local
  140. .IR ramfs (4)
  141. and invokes
  142. .IR acme (1)
  143. on them. When the editor exits,
  144. .I ipso
  145. prompts the user to confirm copying modifed or newly created files back to
  146. .I secstore.
  147. If no
  148. .I file
  149. is mentioned,
  150. .I ipso
  151. grabs all the user's files from
  152. .I secstore
  153. for editing.
  154. .PP
  155. By default, ipso will edit the
  156. .I secstore
  157. files and, if
  158. one of them is named
  159. .BR factotum ,
  160. flush your current keys from factotum and load
  161. the new ones from the file.
  162. If you supply any of the
  163. .BR -e ,
  164. .BR -f ,
  165. or
  166. .BR -l
  167. options,
  168. .I ipso
  169. will just perform the operations you requested, i.e.,
  170. edit, flush, and/or load.
  171. .PP
  172. The
  173. .B -s
  174. option of
  175. .I ipso
  176. invokes
  177. .IR sam (1)
  178. as the editor insted of
  179. .BR acme ;
  180. the
  181. .B -a
  182. option provides a similar service for files encrypted by
  183. .I aescbc
  184. .RI ( q.v. ).
  185. With the
  186. .B -a
  187. option, the full rooted pathname of the
  188. .I file
  189. must be specified and all
  190. .I files
  191. must be encrypted with the same key.
  192. Also with
  193. .BR -a ,
  194. newly created files are ignored.
  195. .PP
  196. .I Aescbc
  197. encrypts and decrypts using AES (Rijndael) in cipher
  198. block chaining (CBC) mode.
  199. .SH SOURCE
  200. .B /sys/src/cmd/auth/secstore
  201. .SH SEE ALSO
  202. .IR factotum (4),
  203. .IR secstore (8)
  204. .SH BUGS
  205. There is deliberately no backup of files on the secstore, so
  206. .B -r
  207. (or a disk crash) is irrevocable. You are advised to store
  208. important secrets in a second location.
  209. .PP
  210. When using
  211. .IR ipso ,
  212. secrets will appear as plain text in the editor window,
  213. so use the command in private.