import 3.2 KB

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