import 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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 -A
  65. Skip the authentication protocol.
  66. This is useful for connecting to foreign systems like Inferno.
  67. .TP
  68. .B -B
  69. Run in ``backwards'' mode, described below.
  70. .TP
  71. .B -E \fIenc
  72. Push an authentication protocol on its network connection.
  73. The supported protocols are
  74. .B clear
  75. (the default, no protocol)
  76. and
  77. .BR ssl .
  78. There are plans to make
  79. .B tls
  80. available.
  81. .TP
  82. .B -e '\fIenc auth\fR'
  83. Specify the encryption and authentication algorithms to use for
  84. encrypting the wire traffic
  85. (see
  86. .IR ssl (3)).
  87. The defaults are
  88. .B rc4_256
  89. and
  90. .BR sha1 .
  91. .TP
  92. .B -k \fIkeypattern
  93. Use
  94. .I keypattern
  95. to select a key to authenticate to the remote side
  96. (see
  97. .IR auth (2)).
  98. .TP
  99. .B -o -O
  100. These equivalent flags run
  101. .I import
  102. in a pre-9P2000 compatibility mode to import from ancient servers.
  103. .TP
  104. .B -p
  105. Push the
  106. .IR aan (8)
  107. filter onto the connection to protect against
  108. temporary network outages.
  109. .TP
  110. .B -s \fIname
  111. Post the connection's mountable file descriptor as
  112. .BI /srv/ name\fR.
  113. .PD
  114. .PP
  115. The
  116. .B -B
  117. option runs
  118. .I import
  119. in ``backwards'' mode.
  120. In this mode,
  121. .I import
  122. runs a
  123. .I p9any
  124. authentication (as server) over its file descriptor 0
  125. (expected to be an incoming network connection from
  126. .B exportfs
  127. .BR -B ),
  128. mounts the connection onto
  129. .IR mntpt ,
  130. and optionally runs
  131. .I cmd
  132. .IR args .
  133. .SH EXAMPLES
  134. Assume a machine
  135. .B kremvax
  136. that has IP interfaces for the company intranet and the global
  137. internet mounted on
  138. .I /net
  139. and
  140. .I /net.alt
  141. respectively.
  142. Any machine inside the company can get telnet out to the global
  143. internet using:
  144. .IP
  145. .EX
  146. import -a kremvax /net.alt
  147. telnet /net.alt/tcp!ucbvax
  148. .EE
  149. .PP
  150. Suppose that the machine
  151. .B moscvax
  152. is has access to a private file server containing public web pages
  153. that need to be served by the less-trusted server
  154. .BR webvax .
  155. .B Webvax
  156. runs the following listener
  157. (see
  158. .IR listen (8))
  159. on TCP port 999:
  160. .IP
  161. .EX
  162. #!/bin/rc
  163. import -B -s rowebfs /usr/web /bin/restarthttpd
  164. .EE
  165. .PP
  166. When
  167. .B moscvax
  168. boots, it runs
  169. .IP
  170. .EX
  171. exportfs -R -r /usr/web -B tcp!webvax!999
  172. .EE
  173. .PP
  174. to serve a read-only copy of
  175. .B /usr/web
  176. to
  177. .BR webvax .
  178. When
  179. .B webvax
  180. gets the call,
  181. .B import
  182. mounts the served tree onto its own
  183. .B /usr/web
  184. and then runs
  185. .B /bin/restarthttpd
  186. to restart
  187. .IR httpd (8).
  188. .SH SOURCE
  189. .B /sys/src/cmd/import.c
  190. .SH SEE ALSO
  191. .IR bind (1),
  192. .IR aan (8),
  193. .IR ssl (3),
  194. .IR exportfs (4),
  195. .IR listen (8),
  196. .B cs
  197. in
  198. .IR ndb (8)