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