import 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. .TH IMPORT 4
  2. .SH NAME
  3. import \- import a name space from a remote system
  4. .SH SYNOPSIS
  5. .B import
  6. [
  7. .I options
  8. ]
  9. .I system
  10. .I file
  11. [
  12. .I mountpoint
  13. ]
  14. .PP
  15. .B import
  16. .B -B
  17. [
  18. .I options
  19. ]
  20. .I mountpoint
  21. [
  22. .I cmd
  23. [
  24. .I args ...
  25. ]
  26. ]
  27. .SH DESCRIPTION
  28. .I Import
  29. allows an arbitrary
  30. .I file
  31. on a remote
  32. .I system
  33. to be imported into the local name space.
  34. Usually
  35. .I file
  36. is a directory, so the complete
  37. file tree under the directory is made available.
  38. .PP
  39. A process is started on the
  40. remote machine, with authority of the user of
  41. .IR import ,
  42. to perform work for the local machine using the
  43. .IR exportfs (4)
  44. service.
  45. If
  46. .I mountpoint
  47. is omitted
  48. .I import
  49. uses the name of the remote
  50. .I file
  51. as the local mount point.
  52. .PP
  53. The options are:
  54. .TP
  55. .B -a -b -c -C
  56. Control the construction of union directories, as in
  57. .I mount
  58. and
  59. .IR bind (1).
  60. Only valid when
  61. .I file
  62. is a directory.
  63. .TP
  64. .B -B
  65. Run in ``backwards'' mode, described below.
  66. .TP
  67. .B -E \fIenc
  68. Push an authentication protocol on its network connection.
  69. The supported protocols are
  70. .B clear
  71. (the default, no protocol)
  72. and
  73. .BR ssl .
  74. There are plans to make
  75. .B tls
  76. available.
  77. .TP
  78. .B -e '\fIenc auth\fR'
  79. Specify the encryption and authentication algorithms to use for
  80. encrypting the wire traffic
  81. (see
  82. .IR ssl (3)).
  83. The defaults are
  84. .B rc4_256
  85. and
  86. .BR sha1 .
  87. .TP
  88. .B -k \fIkeypattern
  89. Use
  90. .I keypattern
  91. to select a key to authenticate to the remote side
  92. (see
  93. .IR auth (2)).
  94. .TP
  95. .B -o -O
  96. These equivalent flags run
  97. .I import
  98. in a pre-9P2000 compatibility mode to import from ancient servers.
  99. .TP
  100. .B -p
  101. Push the
  102. .IR aan (8)
  103. filter onto the connection to protect against
  104. temporary network outages.
  105. .TP
  106. .B -s \fIname
  107. Post the connection's mountable file descriptor as
  108. .BI /srv/ name\fR.
  109. .PD
  110. .PP
  111. The
  112. .B -B
  113. option runs
  114. .I import
  115. in ``backwards'' mode.
  116. In this mode,
  117. .I import
  118. runs a
  119. .I p9any
  120. authentication (as server) over its file descriptor 0
  121. (expected to be an incoming network connection from
  122. .B exportfs
  123. .BR -B ),
  124. mounts the connection onto
  125. .IR mntpt ,
  126. and optionally runs
  127. .I cmd
  128. .IR args .
  129. .SH EXAMPLES
  130. Assume a machine
  131. .B kremvax
  132. that has IP interfaces for the company intranet and the global
  133. internet mounted on
  134. .I /net
  135. and
  136. .I /net.alt
  137. respectively.
  138. Any machine inside the company can get telnet out to the global
  139. internet using:
  140. .IP
  141. .EX
  142. import -a kremvax /net.alt
  143. telnet /net.alt/tcp!ucbvax
  144. .EE
  145. .PP
  146. Suppose that the machine
  147. .B moscvax
  148. is has access to a private file server containing public web pages
  149. that need to be served by the less-trusted server
  150. .BR webvax .
  151. .B Webvax
  152. runs the following listener
  153. (see
  154. .IR listen (8))
  155. on TCP port 999:
  156. .IP
  157. .EX
  158. #!/bin/rc
  159. import -B -s rowebfs /usr/web /bin/restarthttpd
  160. .EE
  161. .PP
  162. When
  163. .B moscvax
  164. boots, it runs
  165. .IP
  166. .EX
  167. exportfs -R -r /usr/web -B tcp!webvax!999
  168. .EE
  169. .PP
  170. to serve a read-only copy of
  171. .B /usr/web
  172. to
  173. .BR webvax .
  174. When
  175. .B webvax
  176. gets the call,
  177. .B import
  178. mounts the served tree onto its own
  179. .B /usr/web
  180. and then runs
  181. .B /bin/restarthttpd
  182. to restart
  183. .IR httpd (8).
  184. .SH SOURCE
  185. .B /sys/src/cmd/import.c
  186. .SH SEE ALSO
  187. .IR bind (1),
  188. .IR aan (1),
  189. .IR ssl (3),
  190. .IR exportfs (4),
  191. .IR listen (8),
  192. .B cs
  193. in
  194. .IR ndb (8)