]> git.lizzy.rs Git - plan9front.git/blob - sys/man/4/import
2c(1), torrent(1), uhtml(1), kbd(3), cwfs(4), hgfs(4), cifsd(8), cryptsetup(8), hjfs...
[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 authentication 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 auth\fR'
99 Specify the encryption and authentication algorithms to use for
100 encrypting 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 -s \fIname
127 Post the connection's mountable file descriptor as
128 .BI /srv/ name\fR.
129 .PD
130 .PP
131 The 
132 .B -B
133 option runs
134 .I import
135 in ``backwards'' mode.
136 In this mode,
137 .I import
138 runs a
139 .I p9any
140 authentication (as server) over its file descriptor 0
141 (expected to be an incoming network connection from
142 .B exportfs
143 .BR -B ),
144 mounts the connection onto
145 .IR mntpt ,
146 and optionally runs
147 .I cmd
148 .IR args .
149 .SH EXAMPLES
150 Assume a machine
151 .B kremvax
152 that has IP interfaces for the company intranet and the global
153 internet mounted on
154 .I /net
155 and
156 .I /net.alt
157 respectively.
158 Any machine inside the company can get telnet out to the global
159 internet using:
160 .IP
161 .EX
162 import -a kremvax /net.alt
163 telnet /net.alt/tcp!ucbvax
164 .EE
165 .PP
166 Suppose that the machine
167 .B moscvax
168 has access to a private file server containing public web pages
169 that need to be served by the less-trusted server
170 .BR webvax .
171 .B Webvax
172 runs the following listener 
173 (see
174 .IR listen (8))
175 on TCP port 999:
176 .IP
177 .EX
178 #!/bin/rc
179 import -B -s rowebfs /usr/web /bin/restarthttpd
180 .EE
181 .PP
182 When
183 .B moscvax
184 boots, it runs
185 .IP
186 .EX
187 exportfs -R -r /usr/web -B tcp!webvax!999
188 .EE
189 .PP
190 to serve a read-only copy of
191 .B /usr/web
192 to
193 .BR webvax .
194 When
195 .B webvax
196 gets the call, 
197 .B import
198 mounts the served tree onto its own
199 .B /usr/web
200 and then runs
201 .B /bin/restarthttpd
202 to restart
203 .IR httpd (8).
204 .SH SOURCE
205 .B /sys/src/cmd/import.c
206 .SH SEE ALSO
207 .IR bind (1),
208 .IR ssl (3),
209 .IR exportfs (4),
210 .IR srv (4),
211 .IR aan (8),
212 .IR listen (8),
213 .B cs
214 in
215 .IR ndb (8)