202 lines · 3.2 KB · Text
RawDownload
.TH IMPORT 4.SH NAMEimport \- import a name space from a remote system.SH SYNOPSIS.B import[.I options].I system.I file[.I mountpoint].PP.B import.B -B[.I options].I mountpoint[.I cmd[.I args ...]].SH DESCRIPTION.I Importallows an arbitrary.I fileon a remote.I systemto be imported into the local name space.Usually.I fileis a directory, so the completefile tree under the directory is made available..PPA process is started on theremote machine, with authority of the user of.IR import ,to perform work for the local machine using the.IR exportfs (4)service.The default port used is TCP 17007.If.I mountpointis omitted.I importuses the name of the remote.I fileas the local mount point..PPThe options are:.TF "-s namexxx".PD.TP.B -a -b -c -CControl the construction of union directories, as in.I mountand.IR bind (1).Only valid when .I fileis a directory..TP.B -ASkip the authentication protocol.This is useful for connecting to foreign systems like Inferno..TP.B -BRun in ``backwards'' mode, described below..TP.B -E \fIencPush an authentication protocol on its network connection.The supported protocols are.B clear(the default, no protocol)and.BR ssl .There are plans to make.B tlsavailable..TP.B -e '\fIenc auth\fR'Specify the encryption and authentication algorithms to use forencrypting the wire traffic(see.IR ssl (3)).The defaults are.B rc4_256and.BR sha1 ..TP.B -k \fIkeypatternUse.I keypatternto select a key to authenticate to the remote side(see.IR auth (2))..TP.B -o -OThese equivalent flags run.I importin a pre-9P2000 compatibility mode to import from ancient servers..TP.B -pPush the.IR aan (8)filter onto the connection to protect againsttemporary network outages..TP.B -s \fInamePost the connection's mountable file descriptor as.BI /srv/ name\fR..PD.PPThe .B -Boption runs.I importin ``backwards'' mode.In this mode,.I importruns a.I p9anyauthentication (as server) over its file descriptor 0(expected to be an incoming network connection from.B exportfs.BR -B ),mounts the connection onto.IR mntpt ,and optionally runs.I cmd.IR args ..SH EXAMPLESAssume a machine.B kremvaxthat has IP interfaces for the company intranet and the globalinternet mounted on.I /netand.I /net.altrespectively.Any machine inside the company can get telnet out to the globalinternet using:.IP.EXimport -a kremvax /net.alttelnet /net.alt/tcp!ucbvax.EE.PPSuppose that the machine.B moscvaxhas access to a private file server containing public web pagesthat need to be served by the less-trusted server.BR webvax ..B Webvaxruns the following listener (see.IR listen (8))on TCP port 999:.IP.EX#!/bin/rcimport -B -s rowebfs /usr/web /bin/restarthttpd.EE.PPWhen.B moscvaxboots, it runs.IP.EXexportfs -R -r /usr/web -B tcp!webvax!999.EE.PPto serve a read-only copy of.B /usr/webto.BR webvax .When.B webvaxgets the call, .B importmounts the served tree onto its own.B /usr/weband then runs.B /bin/restarthttpdto restart.IR httpd (8)..SH SOURCE.B /sys/src/cmd/import.c.SH SEE ALSO.IR bind (1),.IR ssl (3),.IR exportfs (4),.IR srv (4),.IR aan (8),.IR listen (8),.B csin.IR ndb (8)